Query Pipeline Stages
- Configuring query pipeline stages
- Asynchronous query pipeline processing
- Conditional query processing
- Reference topics
- Query rewriting
- Response rewriting
- Fetch data
A query pipeline is made up of a series of query stages that process incoming search queries.
A pipeline stage definition associates a unique ID with a set of properties. These definitions are registered with the Fusion API service and stored in ZooKeeper for re-use across pipelines and search applications.
Configuring query pipeline stages
Asynchronous query pipeline processing
Query pipeline processing performance can be improved by enabling asynchronous processing for certain stages that make requests to secondary collections, external databases, and so on. The following stages support asynchronous processing:
This feature uses the fork-and-join model, where any of the stages above can create a fork on the pipeline. The parallel processes are joined again using the Merge Async Results stage at a later point in the pipeline.
In the Query Workbench, open the query pipeline you want to modify.
Click Add a Stage and select a stage that supports asynchronous processing to your pipeline, or select the stage in your pipeline if it has already been added.
Stages that support this are listed above.
In the stage configuration panel, select Asynchronous Execution Config.
Select Enable Async Execution.Tip
Fusion automatically assigns an Async ID value to this stage. Change this to a more memorable string that describes the asynchronous stages you are merging, such as
Copy the Async ID value.
Verify that the stage is in the correct position in your pipeline.
Click Add a Stage and select the Merge Async Results stage.
In the stage configuration panel, click the Add button next to Async IDs.
Paste the ID from the asynchronous query stage into the new ID field.Tip
When using multiple asynchronous stages, the order in which IDs are entered here is the order in which they are joined back into the pipeline.
The Merge Async Results stage is now the first stage in the pipeline.
Drag the Merge Async Results stage down so that it appears immediately before the Solr Query stage:
Conditional query processing
Query Pipeline stages are used to modify Request objects
condition property in its configuration) that can access these objects.
For example, this condition first checks that the property
fusion-user-name is specified in the Request object, then checks for a particular value:
request.hasParam("fusion-user-name") && request.getFirstParam("fusion-user-name").equals("SuperUser");
See these reference topics for complete details about each query pipeline stage: