Get Started with Fusion Server:
Get Data Out
- Before you begin
- 1. Explore search results
- 2. Configure faceting
- 3. Configure query fields
- 4. Save the query pipeline configuration
- What’s next
- Additional reading
In Part 2, you used Index Workbench to get data into Fusion by previewing the dataset, configuring the index pipeline, and then indexing the data.
In Part 3 (this part), you’ll explore Query Workbench and learn how to configure Fusion’s output (search results), including faceting. Facets are the ubiquitous, dynamic lists of categories or features offered as filters within a search results page.
Before you begin
The dataset has three fields that users of your search application might find relevant:
genres_ss- A list of one or more genre labels
title_txt- The name of the movie
year_i- The movie’s year of release
The field suffixes indicate the type of data stored in each field:
Fields with the suffix
_ss(multi-valued string fields) contain one or more strings values.
String fields require an exact match between the query string and the string value stored in that field.
Fields with the suffix
_txt(text fields) contain text.
Text fields allow for free text search over the field contents. For example, because the movie titles are stored in a text field, a search on the word "Star" will match movies titled "Star", "A Star is Born", all movies in the Star Wars and Star Trek franchises, as well as "Dark Star", "Lone Star", and "Star Kid".
Fields with the suffix
_i(point integer fields) contain integer values.
Numeric fields allow range matches as well as exact matches, and point integer fields allow efficient comparisons between the field’s values and the search criteria.
The different field types allow for different kinds of searches. Configuration of the query pipeline determines how fields are searched.
1. Explore search results
Query Workbench lets you interactively configure a query pipeline while previewing the search results it produces. A query pipeline converts a free text query submitted to your search application into a structured query for Solr.
Log in to Fusion.
In a browser window, open the Fusion UI at
localhost:8764. Enter the password for the user
admin, and then click Login. The Fusion launcher appears.
Click the Movie Search app.
The Fusion workspace appears.
Open Query Workbench. Navigate to Querying > Query Workbench.
1.1. Perform a search
The default search is the wildcard search (
*:*), which returns all documents in the collection. You’ll enter a different search query to get started with facet configuration.
In the search box, enter the query string
star, and then press Enter or click Search .
This search returns all movies that have the word "star" in the title.
The output is configured by the default query pipeline, which has the same name as the collection (in this case,
To see more of the default output, you can perform other searches if you like.
In the search box, enter the query string
*:*to return all documents, and then press Enter or click Search .
|If you find that your data is incorrectly indexed, you can navigate to Indexing > Datasources, click the datasource name, and then click Clear Datasource. The data and its index history are removed from the index so that you can re-index it.|
Fusion only re-indexes data that is not found in the index history. In other words, Fusion won’t overwrite indexed data; it will only re-write existing data after you clear the datasource.
1.2. Explore the role of query pipeline stages
A default query pipeline consists of the stages below. Some of these support Fusion AI features for advanced relevancy tuning, which you can read about separately. In this tutorial, we’ll configure a couple of the basic stages.
Text Tagger - Look for known phrases, synonyms, misspellings, and so on, that can be used to improve the query with query rewriting.
Boost with Signals - Use signals data to boost relevant documents using collaborative filtering.
Query Fields - Specify the set of fields over which to search.
We’ll configure this stage later in this tutorial.
Field Facet - Specify the fields to use for faceting.
We’ll configure this stage, too, for basic faceting and range faceting.
Apply Rules - Modify the query using business rules, if any are triggered.
Solr Query - Perform the query and return the results.
This is the only stage that is always required to perform a query and receive results.
Modify Response with Rules - Modify Solr’s response using business rules, if any are triggered.
Turn off the Solr Query stage.
All search results disappear from the preview pane because Fusion doesn’t send a query to Solr.
Turn on the Solr Query stage and turn all other stages off.
Now the search results look much like they did before. At this point, the disabled stages do not affect the output because they are not yet configured.
Turn all stages on.
2. Configure faceting
Facets are the ubiquitous, dynamic lists of categories or features offered as filters within a search results page. Facets provide a simple way for users to explore and filter their search results without having to construct complicated queries. You configure facets as a part of configuring a query pipeline.
The data you indexed in Part 1 has two fields that are natural choices for faceting:
year_i. For example, a user could search for science fiction of the 1950s in just a few clicks.
2.1. Configure basic faceting for genres
genres_ss field is ready for faceting as-is.
Click Add a field facet and select the
Click Sci-Fi to select movies that have the value
Genres aren’t in any specific order. In configuration for the Field Facet stage, you can choose a value of Sort for the facet field –
index(alphabetical ascending order) or
count(number of documents). Or you can add field facets by configuring the Field Facet stage.
Under the field facet genres_ss, click Clear all.
2.2. Configure range faceting for years
If you were to just configure faceting for the
year_i field as you did above for the
genres_ss field, you would get one facet per year, which isn’t very useful.
year_i field will be more usable if you configure range faceting. Range faceting is a way of grouping values together so that the user can select a value range instead of one specific value. For example, range facets are commonly used with pricing ($50-$100) or ratings (4 stars or higher). Here, we group years by decade.
Range faceting requires sending an additional query parameter to Fusion’s Solr core. You can configure this with the Additional Query Parameters stage. In this case, you’ll use several of Solr’s range facet query parameters.
Use the Additional Query Parameters stage to configure range faceting for the
Click Add a stage.
Scroll down and select Additional Query Parameters.
The Additional Query Parameters configuration panel appears.
Under Parameters and Values, add the following parameter names and values:
Parameter Name Parameter Value
In this case, you do not need to modify the Update Policy field; the default value of
Click Apply, and then Cancel (which just closes the configuration panel for the Additional Query Parameters stage).
The year facets are now grouped by decade:Tip
Facets are not the only way for users to find items by year. In your user application, you can let users search for specific values in the
year_ifield, for example, by using a text field or dropdown list.
3. Configure query fields
In this section, you’ll see why it’s useful to specify which fields Fusion should use to match a query.
Search for "2001".
The results are not what an end user might expect:
"2001: A Space Odyssey" is not the top search result.
Under "Lethal Weapon 2", click show fields.
Here’s the reason: your search query matches the
idfield, but users don’t care about this field.
You’ll use the Query Fields stage to specify the fields that users really care about.
Under "Lethal Weapon 2", click hide fields.
Click the Query Fields stage of the query pipeline.
The Query Fields configuration panel appears.
Under Search Fields, click Add .
Click Add again.
Click Apply, and then Cancel (which just closes the configuration panel for the Query Fields stage).
Now "2001: A Space Odyssey" rises to the top of your search results, followed by films made in the year 2001:
4. Save the query pipeline configuration
In the upper right, click Save.
The Save Pipeline window appears. By default, you’ll overwrite the default query pipeline for this datasource.
Click Save pipeline.
With just two facet fields combined with keyword search, this prototype is already beginning to feel like a real search application.
In Part 4, you’ll enable signals, generate some signal data, aggregate it, and search it to see what it looks like. Signals can be used for recommendations or boosting.