Configure the Highlight Query Pipeline Stage
The Highlight stage allows you to highlight key parts of fields by generating snippets and appending match tags to the highlighted terms. The highlight match tags can then be styled in your web search application.
- Highlight Query Pipeline Stage
-
Introduced in Fusion 5.2.0, the Query Highlight pipeline stage allows you to configure standard options for highlighting using Solr’s Unified highlighter instead of adding Solr request parameters. For instructions, see Configure the Highlight Query Pipeline Stage.
- Additional Query Parameters stage
-
For Fusion 5.2.0 and later, the same method used in Fusion 5.1.x can be used. Configure highlighting with the Additional Query Parameters stage. For instructions, see Configure Highlighting in the Query Workbench.
Instructions
-
Navigate to Querying > Query Workbench.
-
Click Add a Stage and choose Highlight from the list.
-
Click the + Highlight Fields button, and input the field name(s) to configure highlighting for. Repeat to enter multiple fields, if desired.
-
Assign a Snippet count value. With a value of
3
, Fusion will attempt to generate 3 snippets containing highlighted terms. -
Assign a Snippet length value. With a value of
100
, Fusion will attempt to create snippets that are around 100 characters in length. -
Assign Match tag values. These values are used to wrap the highlighted terms. By default,
<em>
and</em>
are used. You can use other values for the match tags, such as<span style="background-color:powderblue;">
and</span>
, but the Fusion UI will not reflect your custom styles. -
(optional) Set Default highlight to
true
if you want to generate snippets even when no highlights are found. The Snippet count and Snippet length values are still in effect. -
Click the Apply button to preview highlighting.
To see highlighting in the Query Workbench, turn it on by setting Format Results > Display highlighting? to
true
: -
If you are satisfied with your changes, click the Save button to save the pipeline.