> ## Documentation Index
> Fetch the complete documentation index at: https://doc.lucidworks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# The Query Workbench

export const LwTemplate = ({title = "Key questions to get you started", icon = "sparkles", cta = "Powered by Agent Studio", linkHref = "https://lucidworks.com/demo/?utm_source=docs&utm_medium=referral&utm_campaign=docs_cta_ai"}) => {
  const [isLoaded, setIsLoaded] = useState(false);
  useEffect(() => {
    const timer = setTimeout(() => {
      setIsLoaded(true);
    }, 500);
    return () => clearTimeout(timer);
  }, []);
  return <div className="lw-template-container">
      <Card title={title} icon={icon}>
        {isLoaded && <span dangerouslySetInnerHTML={{
    __html: `<lw-template id="a029c1a9-28be-427e-b0e1-5d918920246a"></lw-template
            >`
  }} />}
        <Link href={linkHref} className="agent-studio-link text-left text-gray-600 gap-2 dark:text-gray-400 text-sm font-medium flex flex-row items-center hover:text-primary dark:hover:text-primary-light group-hover:text-primary group-hover:dark:text-primary-light">Powered by Lucidworks Agent Studio</Link>
      </Card>
    </div>;
};

[localhost link]: http://localhost:3000/docs/5/fusion/getting-data-out/query-basics/query-workbench

[mintlify link]: https://doc.lucidworks.com/docs/5/fusion/getting-data-out/query-basics/query-workbench

[old doc.lw link]: https://doc.lucidworks.com/fusion/5.9/10918

The Query Workbench is where you edit query pipeline stages, results parameters, and more, then preview the impacts of the changes in real time before saving them. Relevancy tools such as boosting and blocking can be accessed and altered through the Query Workbench. The Query Workbench streamlines the process of querying indexed results and fine-tuning Query Pipelines to surface the results that best satisfy the end user’s needs.

See the [Query Language Cheat Sheet](/docs/5/fusion/getting-data-out/query-basics/query-language-cheat-sheet) for help constructing queries.

<img src="https://mintcdn.com/lucidworks/L5PMnIeZ03zhv8Ti/assets/images/5.6/query-workbench-56.png?fit=max&auto=format&n=L5PMnIeZ03zhv8Ti&q=85&s=25021bc284e46192ae218e42c9339593" alt="Query Workbench" width="2446" height="1208" data-path="assets/images/5.6/query-workbench-56.png" />

With this sandbox paradigm, you can experiment with query pipelines without consequence because Fusion uses a copy of a pipeline to simulate the new results, and it is not permanently modified in the collection until you click **Save**.

<LwTemplate />

## Query pipelines and pipeline stages

[Query pipelines](/docs/5/fusion/getting-data-out/query-basics/query-pipelines/overview) work by processing search requests and returning an ordered list of matching documents. Each pipeline consists of a series of query stages that can be added, ordered, and configured using the Query Workbench.

Select any stage in the pipeline to open its configuration panel:

<img src="https://mintcdn.com/lucidworks/L5PMnIeZ03zhv8Ti/assets/images/5.6/query-workbench-stage-config-56.png?fit=max&auto=format&n=L5PMnIeZ03zhv8Ti&q=85&s=4ecd7bb41669b50980d5c4d5b324b13a" alt="Stage configuration panel" width="2448" height="1214" data-path="assets/images/5.6/query-workbench-stage-config-56.png" />

## Boosting and blocking

As you search your data and inspect the results, you can manipulate the rankings of individual documents. Boosting a document raises its ranking, while blocking a document removes it from search results.

Boosting and blocking affects the results for specific queries. For example, when you search for "citizen" and boost the document for "Citizen Kane", your end users will see that title boosted to the top when they also search for "citizen", but not necessarily when they search for "kane".

The Query Workbench provides convenient buttons for instantly blocking or boosting the documents that you see in the preview panel. Clicking **Boost** automatically adds the [Boost Documents stage](/docs/5/fusion/reference/config-ref/pipeline-stages/query-stages/boost-documents-query-stage) to your query pipeline, with a boost rule that matches your query and the document you clicked. Likewise, clicking **Block** adds and configures the [Block Documents stage](/docs/5/fusion/reference/config-ref/pipeline-stages/query-stages/block-documents-query-stage).

## Compare mode

Compare mode allows you to compare search results using two different query pipelines, or compare search results from the original query pipeline and the copy being modified in the Query Workbench. On the right is the working pipeline, which you can edit. On the left is one of your saved pipelines.

## Learn more

<AccordionGroup>
  <Accordion title="Boost or Block with the Query Workbench">
    1. How to boost a document in the Query Workbench
    2. In the preview panel, hover over the document you want to boost.
           <img src="https://mintcdn.com/lucidworks/l9y7VqRhZkN9hmR0/assets/images/4.0/query-workbench-boost.png?fit=max&auto=format&n=l9y7VqRhZkN9hmR0&q=85&s=e06fb38c348f0d7083725d8792db1d07" alt="Boosting" width="2454" height="1170" data-path="assets/images/4.0/query-workbench-boost.png" />
    3. Click **Boost**.
       The preview panel automatically updates the rankings of the search results, and tags the differences:
           <img src="https://mintcdn.com/lucidworks/l9y7VqRhZkN9hmR0/assets/images/4.0/query-workbench-boosted.png?fit=max&auto=format&n=l9y7VqRhZkN9hmR0&q=85&s=0e14f73a8fd29cd10049326d7e3946c0" alt="Boosted result" width="2452" height="1171" data-path="assets/images/4.0/query-workbench-boosted.png" />
       Notice that the Boost Documents stage is now in our pipeline. You can click this stage to view the boost rules you have added. This is also where you can remove boost rules:
           <img src="https://mintcdn.com/lucidworks/l9y7VqRhZkN9hmR0/assets/images/4.0/query-workbench-boostdocs-stage.png?fit=max&auto=format&n=l9y7VqRhZkN9hmR0&q=85&s=ac4458d3f610d944ffff1c1412c8f8e2" alt="Boost Documents stage" width="2443" height="1287" data-path="assets/images/4.0/query-workbench-boostdocs-stage.png" />
    4. When you are satisfied with the results, save the query pipeline.

    **How to block a document in the Query Workbench**

    1. In the preview panel, hover over the document you want to block.

           <img src="https://mintcdn.com/lucidworks/l9y7VqRhZkN9hmR0/assets/images/4.0/query-workbench-block.png?fit=max&auto=format&n=l9y7VqRhZkN9hmR0&q=85&s=4e9dc3ed502f4288253dd2387f7bf287" alt="Blocking" width="2452" height="1284" data-path="assets/images/4.0/query-workbench-block.png" />
    2. Click **Block**

       The preview panel automatically updates the rankings of the search results, and tags the differences.

           <img src="https://mintcdn.com/lucidworks/l9y7VqRhZkN9hmR0/assets/images/4.0/query-workbench-blocked.png?fit=max&auto=format&n=l9y7VqRhZkN9hmR0&q=85&s=ce9bce21e77eaf333f24fe54f10015df" alt="Blocked result" width="2447" height="1280" data-path="assets/images/4.0/query-workbench-blocked.png" />

       Notice that the Block Documents stage is now in our pipeline. You can click this stage to view the block rules you have added. This is also where you can remove block rules:

           <img src="https://mintcdn.com/lucidworks/l9y7VqRhZkN9hmR0/assets/images/4.0/query-workbench-blockdocs-stage.png?fit=max&auto=format&n=l9y7VqRhZkN9hmR0&q=85&s=bdd5ad7bc26be833ee2ce279c6d90686" alt="Block Documents stage" width="2459" height="1288" data-path="assets/images/4.0/query-workbench-blockdocs-stage.png" />
    3. When you are satisfied with the results, save the query pipeline.
  </Accordion>

  <Accordion title="Edit Parameters in the Query Workbench">
    The Query Workbench allows you to edit the search parameters. Click **Parameters** to display the current search parameters and the **Edit parameters** button:

    <img src="https://mintcdn.com/lucidworks/l9y7VqRhZkN9hmR0/assets/images/4.0/query-workbench-parameters.png?fit=max&auto=format&n=l9y7VqRhZkN9hmR0&q=85&s=13b4c545374d147931025a768e7228de" alt="Search parameters" width="2463" height="1322" data-path="assets/images/4.0/query-workbench-parameters.png" />

    Then, click **Edit parameters** to open the "Parameters and Values" window where you can add, modify, or remove search parameters:

    <img src="https://mintcdn.com/lucidworks/l9y7VqRhZkN9hmR0/assets/images/4.0/query-workbench-parameters-edit.png?fit=max&auto=format&n=l9y7VqRhZkN9hmR0&q=85&s=c230f6eaa8bfa62be29d93e0151aeac7" alt="Parameters and Values" width="2560" height="1406" data-path="assets/images/4.0/query-workbench-parameters-edit.png" />
  </Accordion>

  <Accordion title="Enable Asynchronous Query Pipeline Processing">
    1. In the Query Workbench, open the query pipeline you want to modify.
    2. Click **Add a Stage** and select a stage that supports asynchronous processing:
       * Active Directory Security Trimming
       * Security Trimming
       * Boost with Signals
       * Apply Rules
       * JDBC Lookup
       * LWAI Vectorize Query
       * Solr Subquery
       * LWAI Prediction Query
    3. In the stage configuration panel, select **Asynchronous Execution Config**.
    4. Select **Enable Async Execution**.\\
           <img src="https://mintcdn.com/lucidworks/zH_ln2rWO5G9pvTA/assets/images/5.0/query-async-enable.png?fit=max&auto=format&n=zH_ln2rWO5G9pvTA&q=85&s=75fad9773fd98ebe72a18b7ae1405a08" alt="Enabling asynchronous processing" width="1805" height="1198" data-path="assets/images/5.0/query-async-enable.png" />

    <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 `signals` or `access_control`.
    </Tip>

    5. Copy the **Async ID** value.
    6. Click **Apply**.\
       Verify that the stage is in the correct position in your pipeline.
    7. Click **Add a Stage** and select the Merge Async Results stage.\\
           <img src="https://mintcdn.com/lucidworks/zH_ln2rWO5G9pvTA/assets/images/5.0/query-async-merge1.png?fit=max&auto=format&n=zH_ln2rWO5G9pvTA&q=85&s=25c9498d379d804d087ba69e310b1142" alt="Add the Merge Async Results stage" width="1753" height="1208" data-path="assets/images/5.0/query-async-merge1.png" />
    8. In the stage configuration panel, click the Add <img className="inline-image" alt="add-icon" src="https://mintcdn.com/lucidworks/5yWZ-KtZuBe4Y_Fg/assets/images/4.0/icons/add-icon.png?fit=max&auto=format&n=5yWZ-KtZuBe4Y_Fg&q=85&s=4a774a0fe7398e91eb7273f8e8aff7be" width="44" height="42" data-path="assets/images/4.0/icons/add-icon.png" /> button next to **Async IDs**.
    9. 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.
    </Tip>

    10. Click **Apply**.\
        The Merge Async Results stage is now the first stage in the pipeline.
    11. Drag the Merge Async Results stage down so that it appears immediately before the Solr Query stage:
            <img src="https://mintcdn.com/lucidworks/zH_ln2rWO5G9pvTA/assets/images/5.0/query-async-merge2.png?fit=max&auto=format&n=zH_ln2rWO5G9pvTA&q=85&s=cb616233023476d7eb387b898562ed9e" alt="Move the Merge Async Results" width="1768" height="1205" data-path="assets/images/5.0/query-async-merge2.png" />
    12. Click **Save**.
  </Accordion>

  <Accordion title="Enable and Disabling Query Pipeline Stages">
    By default, every stage in a query pipeline is enabled. While working with a query pipeline, it can be helpful to disable stages without removing them completely. This allows you to preserve a stage’s configuration while observing how the search results change in its absence. You can re-enable the stage at any time. When you save a query pipeline, the enabled/disabled state of each stage is also saved.

    <img src="https://mintcdn.com/lucidworks/l9y7VqRhZkN9hmR0/assets/images/4.0/query-workbench-stage-disable.png?fit=max&auto=format&n=l9y7VqRhZkN9hmR0&q=85&s=d8302a5134d17fcee3aefc9ea8651f24" alt="Enable/disable stages" width="657" height="628" data-path="assets/images/4.0/query-workbench-stage-disable.png" />

    Click the circle next to any stage in order to enable or disable it.
  </Accordion>

  <Accordion title="Use Federated Search">
    Federated search lets you query across multiple collections in Fusion. This is useful if you keep separate data collections for security or compliance reasons or maintain different collections based on data type.

    1. In the Fusion workspace, navigate to **Querying > Query Workbench**.

    2. Click **Solr Query** to open the Solr Query panel.

    3. Enable **Allow Federated Search** then click **Apply**.\\
           <img src="https://mintcdn.com/lucidworks/L5PMnIeZ03zhv8Ti/assets/images/5.6/enable-federated-search.png?fit=max&auto=format&n=L5PMnIeZ03zhv8Ti&q=85&s=bbd71912cbba91b9265238e7991bebba" alt="Enable Federated Search" width="2278" height="1264" data-path="assets/images/5.6/enable-federated-search.png" />

    4. In the workbench area, click **Parameters** then click **Edit Parameters**.

    5. Click Add <img className="inline-image" alt="Add" src="https://mintcdn.com/lucidworks/5yWZ-KtZuBe4Y_Fg/assets/images/4.0/icons/add-icon.png?fit=max&auto=format&n=5yWZ-KtZuBe4Y_Fg&q=85&s=4a774a0fe7398e91eb7273f8e8aff7be" width="44" height="42" data-path="assets/images/4.0/icons/add-icon.png" /> to add a parameter. For the **Name**, enter `collection` and for the **Parameter Value**, enter a comma-separated list of collections you want to query. For example, `movies-collection,books-collection,music-collection`.\\
           <img src="https://mintcdn.com/lucidworks/L5PMnIeZ03zhv8Ti/assets/images/5.6/edit-parameters-collection.png?fit=max&auto=format&n=L5PMnIeZ03zhv8Ti&q=85&s=9945d5667b9e7002fe2b71f896a70618" alt="Edit parameters example" width="2468" height="762" data-path="assets/images/5.6/edit-parameters-collection.png" />

    6. Click **Close**.

    7. Check that your pipeline is querying documents from all specified collections.\\
           <img src="https://mintcdn.com/lucidworks/L5PMnIeZ03zhv8Ti/assets/images/5.6/federated-search-docs.png?fit=max&auto=format&n=L5PMnIeZ03zhv8Ti&q=85&s=d85e26159ebde563eb3dae8f363cba0d" alt="Federated docs results" width="722" height="124" data-path="assets/images/5.6/federated-search-docs.png" />
  </Accordion>

  <Accordion title="Format Search Results in the Query Workbench">
    Ultimately, your search application will format the search results that end users see. The Query Workbench provides some formatting options for the preview panel.

    At the bottom of the screen, click **Format Results** to configure how results are displayed in the QWB:

    <img src="https://mintcdn.com/lucidworks/l9y7VqRhZkN9hmR0/assets/images/4.0/query-workbench-format-results.png?fit=max&auto=format&n=l9y7VqRhZkN9hmR0&q=85&s=38348f8e02a5221d32cfaad0a185b67c" alt="Format results" width="2462" height="1324" data-path="assets/images/4.0/query-workbench-format-results.png" />

    These options only affect how the Query Workbench displays results; they have no effect on how your search application displays them.
  </Accordion>

  <Accordion title="Step-by-step Query Workbench Workflow">
    1. Use the Index Workbench to set up datasource(s).
    2. Run a crawl on the data.
    3. Open the Query Workbench.
    4. Select a query pipeline to use or create a new, blank pipeline (the Default pipeline is created automatically and can be used as-is or with modification).
    5. Modify the pipeline stages and set the order in which the queries will run.
    6. Examine the live results in the Search panel.
    7. Modify any pertinent stage settings to fine tune your results.
    8. Click **Save** to commit the new settings to the pipeline

    After a custom Query Pipeline configuration is saved, it becomes available throughout Fusion and can be re-used and modified.
  </Accordion>

  <Accordion title="Reorder Query Pipeline Stages">
    The order of the pipeline stages matters, because the output from one stage becomes the input to the next stage. For example, the Solr Query stage must always come last in the sequence, so that data is indexed only after it has been processed by all other stages. Putting this stage first in the sequence means that subsequent stages have no effect on the indexed data.

    <img src="https://mintcdn.com/lucidworks/l9y7VqRhZkN9hmR0/assets/images/4.0/query-workbench-stage-reorder.png?fit=max&auto=format&n=l9y7VqRhZkN9hmR0&q=85&s=e82f1c14a71bf729e0706fe1472158c9" alt="Re-order stages" width="653" height="626" data-path="assets/images/4.0/query-workbench-stage-reorder.png" />

    Drag any stage in the pipeline to move it up or down in the sequence of stages. The preview panel automatically updates the search results to reflect the output of the new sequence.
  </Accordion>

  <Accordion title="Select Fields to Display in the Query Workbench">
    While the Query Fields stage configures which fields match against incoming queries, the search application itself determines which fields to display in the search results.

    For example, the search results below use the `title_s` field as the document name and the `year_i` field as the document description:

    <img src="https://mintcdn.com/lucidworks/l9y7VqRhZkN9hmR0/assets/images/4.0/query-workbench-displayfields.png?fit=max&auto=format&n=l9y7VqRhZkN9hmR0&q=85&s=b1bb66f967505ec69ba839cff6590295" alt="Display fields" width="2455" height="1328" data-path="assets/images/4.0/query-workbench-displayfields.png" />

    Adding `year_i` as the description removed it from the list of field facets and now we see the year of release for each movie title in the search results:

    <img src="https://mintcdn.com/lucidworks/l9y7VqRhZkN9hmR0/assets/images/4.0/query-workbench-displayfields2.png?fit=max&auto=format&n=l9y7VqRhZkN9hmR0&q=85&s=dff7e66d4e9969e404255d0cadc1f06f" alt="Updated display fields" width="2410" height="1283" data-path="assets/images/4.0/query-workbench-displayfields2.png" />
  </Accordion>

  <Accordion title="Compare Two Query Pipelines">
    1. In the Query Workbench, click **Compare**.\
       Another preview panel opens. In this view, you can compare results from one query pipeline side by side with another query pipeline.
    2. In the left panel, select a pipeline to compare to your working pipeline.\
       Now you can see how the search results differ between the two pipelines:
           <img src="https://mintcdn.com/lucidworks/l9y7VqRhZkN9hmR0/assets/images/4.0/query-workbench-compare.png?fit=max&auto=format&n=l9y7VqRhZkN9hmR0&q=85&s=bf44b14352b13a66948963e623e432ca" alt="Compare mode" width="2450" height="1302" data-path="assets/images/4.0/query-workbench-compare.png" />

    <Tip>
      When you click a document in one panel, the other panel automatically scrolls to the same document.
    </Tip>

    To exit compare mode, click the Close <img className="inline-image" alt="Close" src="https://mintcdn.com/lucidworks/2n5qtVSsU54oMlB1/assets/images/3.1/Object_Explorer/x_to_close.png?fit=max&auto=format&n=2n5qtVSsU54oMlB1&q=85&s=42ef7da549b1615ab658f07cb3b722e8" width="28" height="22" data-path="assets/images/3.1/Object_Explorer/x_to_close.png" /> icon.
  </Accordion>
</AccordionGroup>
