# Solr Search

The Solr Search application, which is based on Apache Solr, allows you to perform keyword searches across Hadoop data. A wizard lets you style the result snippets, specify facets to group the results, sort the results, and highlight result fields.

## New Search feature: Graphical facets

This feature lets you search interactively:

As usual feel free to comment on the hue-user list or @gethue!

## Solr Search Installation and Configuration

Solr Search is one of the applications installed as part of Hue. For information about installing and configuring Hue, see the Hue Installation manual.

## Starting Solr Search

Click the Solr Search icon () in the navigation bar at the top of the Hue browser page. Solr Search opens to the Collection Manager. If there are no collections, the Import Collections and Cores dialog displays.

## Collection Manager

In Collection Manager you import, copy, and delete collections.

### Displaying the Collection Manager

When you start Solr Search, the Collection Manager displays. You navigate to the Collection Manager by clicking Collection manager in the Search page or the Template Editor.

### Filtering Collections

When you type in the Filter field, the list of collections is dynamically filtered to display only those rows containing text that matches the specified substring.

### Importing Collections

1. If there are existing collections, click the Import button at the top right. The Import Collections and Cores dialog displays.
2. Check the checkboxes next to the collections to import.
3. Click Import Selected. The collection is added to the Collection Manager.

### Editing Collection Properties

1. In the Collection Manager, click a collection.
2. In the COLLECTION area on the left, click Properties.
3. Edit a property and click Save.

### Searching a Collection

1. In the Collection Manager, click Search page or click Search it in the Collection area on the left. The Search page displays.
2. Select a collection from the Search in drop-down list.
3. Type a search string in the Search... text box.

4. Press Enter or click the icon.

5. If you have defined facets, click a facet to display only those results in the group defined by the facet.

6. If you have defined sorting fields, select from the Sort by drop-down list to sort the results.
7. Click 'X' to clear the search string.

## Styling Search Results

Do one of the following:

- In the Collection Manager, click a collection.
- In the Search page, select a collection from the Search in drop-down list and click Customize this collection. The Template Editor displays.

### Template Editor

The Template Editor provides four features:

- Snippet editor - Specify the layout of the search result snippet, which fields appear in the snippet, and style the results.
- Facet editor - Define buckets in which to group results.
- Sort editor - Specify on which fields and order the results are sorted.
- Highlighting editor - Enable highlighting of search fields.

#### Snippet Editor

1. In the Snippet Editor, click a tab to choose the method for editing the search snippet fields and styling:
2. - Visual editor - Click to choose an overall layout for the snippet.
3. - - Select the fields and functions from the drop-down lists on the right and click .
4. - - Select fields, right-click, and select Cut and Paste to place the fields on the canvas.
5. - - Select fields and apply styling using the buttons on top.
6. - Source -
7. - - Select the data fields and functions from the drop-down lists on the right.
8. - - Specify layout and styling using HTML tags.
9. - Preview - Preview the snippet.
10. - Advanced - Specify styles for CSS classes specified in the Source tab.
11. Click Save.

#### Facet Editor

By default, faceting search result fields is disabled. Click Enabled to enable faceting.

1. In the Template Editor, click 2. Facets. You can move between the facet tabs by clicking each Step tab, or by clicking Back and Next.
2. In the General tab, specify
3. - Limit - the maximum number of values for each facet.
4. - Mincount - the minimum number of search results that fall into a group for the facet to display on the Search page.
5. In the Field, Range, and Date Facet tabs, specify the facet properties and click Add.
6. In the Facets Order tab, drag and drop the facet to specify the order in they appear in the Search page.
7. Click Save. When you display the Search page, the facets display on the left.

#### Sorting Editor

By default, sorting on search result fields is disabled. Click Enabled to enable sorting.

1. In the Template Editor, click 3. Sorting.
2. In the Field drop-down, select a field. Optionally specify a label for the field.
3. The default order is ascending. Click the arrows to change the order.
4. Click Add.
5. Click Save. When you display search results, the results are sorted by the fields in the order that they appear left to right.

#### Highlighting Editor

By default,highlighting search result fields is disabled. Click Enabled to enable highlighting.

1. In the Template Editor, click 3. Highlighting.
2. Select the fields to be highlighted.
3. Click Save. When you display search results, the selected fields are displayed with the style of the em class defined in the Advanced tab of the Snippet editor.