> ## 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.

# Query Pipelines

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/4/fusion-server/concepts/querying/pipelines/query-pipelines

[mintlify link]: https://doc.lucidworks.com/docs/4/fusion-server/concepts/querying/pipelines/query-pipelines

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

A Query Pipeline transforms a set of inputs into a Solr query request and it can execute requests and manipulate the Solr response as well, via a set of modularized operations called [Query Stages](/docs/4/fusion-server/concepts/querying/pipelines/query-pipeline-stages). The objects sent from stage to stage are Request objects and Response objects.

Fusion stores pipeline names and definitions, allowing a pipeline to be reused across applications. Pipeline definitions can be modified, so that as an application evolves, the pipelines used by that application can evolve accordingly. During application development, the Fusion UI can be used to develop and debug a Query Pipeline.

The available stage types allow setting specific parameters for the query, such as the number of results to return or the query parser to use. You can also define facets and recommendations to be returned with the results. If Access Control Lists (ACLs) are in use, you can apply a security-trimming stage to apply user access restrictions to the results.

For details about the available REST APIs, see [Query Pipelines API](/docs/4/fusion-server/reference/api/query/query-pipelines-api) and [Query Stages API](/docs/4/fusion-server/reference/api/query/query-stages-api).

<LwTemplate />

## Default Query Pipelines

When you create a new app with a default collection, the collection includes a default query pipeline. When you create a new collection in an existing app, Fusion also creates a default query pipeline for the new collection. The pipeline name is the same as the collection name.

The default query pipeline has the following pre-configured stages:

* [Text Tagger](/docs/4/fusion-server/reference/pipeline-stages/query/text-tagger-query-stage)\
  This stage uses the [SolrTextTagger](https://solr.apache.org/guide/solr/latest/query-guide/tagger-handler.html) handler to identify known entities in the query by searching either of the following:
* `_query_rewrite` collection. See **Manage Collections in the Fusion UI** for more information.
* `_query_rewrite_staging` collection in the case of the Fusion AI query rewriting [Simulator](/docs/4/fusion-ai/concepts/query-rewriting/simulator).
* `_query_rewrite` collection. See **Manage Collections in the Fusion UI** for more information.

<Accordion title="Manage Collections in the Fusion UI">
  Collections can be created or removed using the Fusion UI or the REST API.

  For information about using the REST API to manage collections, see Collections API in the REST API Reference:

  * **Fusion 5.x.** [Collections API](/api-reference/collections/get-collections-service-status)
  * **Fusion 4.x.** [Collections API](/docs/4/fusion-server/reference/api/collections-api)

  ## Creating a Collection

  When you create an app, by default Fusion Server creates a collection and associated objects.

  To create a new collection in the Fusion UI:

  1. From within an app, click **Collections > Collections Manager**.
  2. At the upper right of the panel, click **New**.
  3. Enter a **Collection name**. This name cannot be changed later.
  4. To create the collection in the default Solr cluster and with other default settings, click **Save Collection**.

  ## Creating a Collection with Advanced Options

  To access advanced options for creating a collection in the Fusion UI:

  1. From within an app, click **Collections > Collections Manager**.
  2. At the upper right of the panel, click **New**.
  3. Enter a **Collection name**. This name cannot be changed later.
  4. Click **Advanced**.
  5. Configure advanced options. The options are described below.
  6. Click **Save Collection**.

  ### Solr Cluster

  By default, a new collection is associated with the Solr instance that is associated with the `default` Solr cluster.

  If Fusion has multiple Solr clusters, choose from the list which cluster you want to associate your collection with.
  The cluster must exist first.

  ### Solr Cluster Layout

  The next section lets you define a **Replication Factor** and **Number of Shards**.
  Define these options only if you are creating a new collection in the Solr cluster.
  If you are linking Fusion to an existing Solr collection, you can skip these settings.

  ### Solr Collection Import

  Import a Solr collection to associate the new Fusion collection with an existing Solr collection.
  Enter a **Solr Collection Name** to associate the collection with an existing Solr collection.
  Then, enter a **Solr Config Set** to tell ZooKeeper to use the configurations from an existing collection in Solr when creating this collection.

  ### Time Series Partitioning

  <Note>Available in 4.x only.</Note>

  You can map a Fusion collection to multiple Solr collections, known here as partitions, where each partition contains data from a specific time range.

  To configure time-based partitioning, under **Time Series Partitioning** click **Enable**.

  See [Time-Based Partitioning](/docs/4/fusion-server/concepts/indexing/collections/time-based-partitioning) for more information.

  ## Configuring Collections

  The Collections menu lets you configure your existing collection, including datasources, fields, jobs, stopwords, and synonyms.

  In the Fusion UI, from any app, the Collections icon displays on the left side of the screen.

  Some tasks related to managing a collection are available in other menus:

  * Configure a profile in **Indexing > Indexing Profiles** or **Querying > Query Profiles**.
  * View reports about your collection’s activity in **Analytics > Dashboards**.

  ### Collections Manager

  The Collections Manager page displays details about the collection, such as how many datasources are configured, how many documents are in the index, and how much disk space the index consumes.

  This page also lets you [create a new collection](#creating-a-collection), disable search logs or signals, enable recommendations, issue a commit command to Solr, or clear a collection.

  #### Disable search logs

  When you first create a collection, the search logs are created by default. The search logs populate the panels in **Analytics > Dashboards**.

  1. Hover over your collection name until the gear icon appears at the end of the line.
  2. Click the gear icon.
  3. Click **Disable Search Logs**.
  4. On the confirmation screen, click **Disable Search Logs**.

  Note that if you disable search logs, you cannot see any data for this collection in **Analytics > Dashboards**.

  See Dashboards:

  * **Fusion 5.x.** [Dashboards](/docs/5/fusion/operations/monitoring-and-reporting/banana-dashboards/overview)
  * **Fusion 4.x.** [Dashboards](/docs/4/fusion-server/concepts/dashboards/overview)

  #### Disable signals

  When you first create a collection, the signals and aggregated signals collections are created by default.

  1. Hover over your collection name until the gear icon appears at the end of the line.
  2. Click the gear icon.
  3. Click **Disable Signals**.
  4. On the confirmation screen, click **Disable Signals**.

  #### Hard commit a collection

  1. Hover over your collection name until the gear icon appears at the end of the line.
  2. Click the gear icon.
  3. Click  **Hard Commit Collection**.
  4. On the confirmation screen, click **Hard Commit Collection**.

  Read internal details about how Solr processes commits on [our blog](https://lucidworks.com/post/understanding-transaction-logs-softcommit-and-commit-in-sorlcloud/).

  ### Datasources

  To access the Datasources page, click **Indexing > Datasources**. By default, there are no datasources configured right after installation.

  To add a new datasource, click **New** at the upper right of the panel.

  See the [Connectors and Datasources Reference](/docs/fusion-connectors/connectors/overview) for details on how to configure a datasource. Options vary depending on the repository you would like to index.

  After you configure a datasource, it appears in a list on this screen. Click the name of a datasource to edit its properties. Click **Start** to start the datasource. Click **Stop** to stop the datasource before it completes.
  To the right, view information on the last completed job, including the date and time started and stopped, and the number of documents found as new, skipped, or failed.

  <Note>When you stop a datasource, Fusion attempts to safely close connector threads, finishing processing documents through the pipeline and indexing documents to Solr. Some connectors take longer to complete these processes than others, so might stay in a "stopping" state for several minutes.</Note>

  To stop a datasource immediately, choose **Abort** instead of **Stop**.

  There is also a REST API for datasources:

  * **Fusion 5.x.** [Connector Datasources API](/api-reference/datasource-configuration-api/list-all-datasource-configurations)
  * **Fusion 4.x.** [Connector Datasources API](/docs/4/fusion-server/reference/api/connector-apis/connector-datasources-api)

  ### Stopwords

  The Stopwords page lets you edit a stopwords list for your collection.

  To add or delete stop words:

  1. Click the name of the text file you wish to edit.
  2. Add a new word on a new line.
  3. When you are done with your changes, click **Save**.

  To import a stop words list:

  1. Click **System > Import Fusion Objects**.
  2. Choose the file to upload.
  3. Click **Import >>**.

  Read more about stopwords:

  * **Fusion 5.x.** [stopwords](/docs/5/fusion/getting-data-out/query-enhancement/stopwords-files)
  * **Fusion 4.x.** [stopwords](/docs/4/fusion-server/concepts/querying/apps/stopwords-files)

  ### Synonyms

  Fusion has the same synonym functionality that Solr supports. This includes a list of words that are synonyms (where the synonym list expands on the terms entered by the user), as well as a full mapping of words, where a word is substituted for what the user has entered (that is, the term the user has entered is replaced by a term in the synonym list).

  See more about synonyms:

  * **Fusion 5.x.** [synonyms](/docs/5/fusion/getting-data-out/query-enhancement/synonyms/overview)
  * **Fusion 4.x.** [synonyms](/docs/4/fusion-server/concepts/querying/apps/synonyms-files)

  You can edit the synonyms list for your collection.

  To access the Synonyms page in the Fusion UI, in any app, click **Collections > Synonyms**.

  Filter the list of synonym definitions by typing in the **Filter...** box.

  To import a synonyms list:

  1. From the Synonyms page, click **Import and Save**. A dialog box opens.
  2. Choose the file to import.

  To edit a synonyms list:

  * Enter new synonym definitions one per line.
    * To enter a string of terms that expand on the terms the user entered, enter the terms separated by commas, like `Television, TV`.
    * To enter a term that should be mapped to another term, enter the terms separated by an equal sign then a right angle bracket, `=>`, like `i-pod=>ipod`.
  * Remove a line by clicking the **x** at the end of the line.
  * Once you are finished with edits, click **Save**.

  To export the synonyms list, click **Export**. This downloads the list to your computer using your browser download capability.

  ### Profiles

  Profiles allow you to create an alias for an index or query pipeline.
  This allows you to send documents or queries to a consistent endpoint and change the underlying pipeline or collection as needed.

  Read about profiles in Index Profiles and Query Profiles:

  * **Fusion 5.x.**
    * [Index Profiles](/docs/4/fusion-server/concepts/indexing/datasources/index-profiles)
    * [Query Profiles](/docs/4/fusion-server/concepts/querying/pipelines/query-profiles)
  * **Fusion 4.x.**
    * [Index Profiles](/docs/4/fusion-server/concepts/indexing/datasources/index-profiles)
    * [Query Profiles](/docs/4/fusion-server/concepts/querying/pipelines/query-profiles)

  To access the Solr Config page, from any app, click **System > Solr Config**.

  ## Learn more

  <Card title="Collections Menu Tour" class="note-image" href="https://academy.lucidworks.com/collections-menu-tour" cta="Take this course on the LucidAcademy." icon="graduation-cap" iconType="duotone">
    The quick learning for **Collections Menu Tour** focuses on the Collections Menu features and functionality along with a brief description of each screen available in the menu.
  </Card>
</Accordion>

To perform [query rewriting](/docs/4/fusion-ai/concepts/query-rewriting/overview), this stage searches for matching instances of:

* [spelling corrections](/docs/4/fusion-ai/concepts/query-rewriting/misspelling-detection)
* [phrase boosts](/docs/4/fusion-ai/concepts/query-rewriting/phrase-detection)
* [underperforming query improvements](/docs/4/fusion-ai/concepts/query-rewriting/underperforming-queries)
* [synonym expansions](/docs/4/fusion-ai/concepts/query-rewriting/synonym-detection)
* [Boost with Signals](/docs/4/fusion-ai/reference/query-pipeline-stages/recommendation-boosting-query-stage)\
  The Boost with Signals query pipeline stage uses [aggregated signals](/docs/4/fusion-ai/concepts/signals-and-aggregations/aggregations/overview) to selectively boost items in the set of search results.
* [Query Fields](/docs/4/fusion-server/reference/pipeline-stages/query/search-fields-query-stage)\
  The Query Fields query pipeline stage defines common Solr query parameters for the [edismax query parser](https://cwiki.apache.org/confluence/display/solr/The+Extended+DisMax+Query+Parser). If using a less-than sign (\<) with DisMax, it must be escaped using a backslash.\
  An alternative to this stage is the
  [Additional Query Parameters stage](/docs/4/fusion-server/reference/pipeline-stages/query/set-query-params-stage).
* [Field Facet](/docs/4/fusion-server/reference/pipeline-stages/query/facet-query-stage)\
  The Field Facet query pipeline stage is used to add a
  [Solr Field Facet query](https://cwiki.apache.org/confluence/display/solr/Faceting#Faceting-Field-ValueFacetingParameters)
  to the search query pipeline.
* [Apply Rules](/docs/4/fusion-server/reference/pipeline-stages/query/query-rules-query-stage)
* A [Solr Query](/docs/4/fusion-server/reference/pipeline-stages/query/solr-query-stage)\
  The Solr Query stage transforms the Fusion query pipeline
  [Request](https://javadoc.lucidworks.com/fusion-pipeline-javadocs/4.2/com/lucidworks/apollo/pipeline/query/Request.html)
  object into a Solr query and sends it to Solr.
* [Modify Response with Rules](/docs/4/fusion-server/reference/pipeline-stages/query/rules-augment-response-query-stage)\
  Most rules operate on the request, but some [rule types](/docs/4/fusion-ai/concepts/query-rewriting/overview), such as banner rules or redirect rules, do their work when the response comes back. The Modify Response with Rules stage applies those rules to the response. For example, a banner rule can add a banner URL to the response before returning it to the client.

## Custom Query Pipelines

Using the [Query Workbench](/docs/4/fusion-server/concepts/querying/query-workbench) or the [REST API](/docs/4/fusion-server/reference/api/query/query-pipelines-api), you can develop custom pipelines to suit any search application. Start with any of Fusion’s built-in query pipelines, then add, remove, and re-order the [pipeline stages](/docs/4/fusion-server/concepts/querying/pipelines/query-pipeline-stages) as needed to produce the appropriate query results.

## 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:

* [Active Directory Security Trimming](/docs/4/fusion-server/reference/pipeline-stages/query/active-directory-security-trimming-query-stage)
* [Apply Rules](/docs/4/fusion-server/reference/pipeline-stages/query/query-rules-query-stage)
* [Boost with Signals](/docs/4/fusion-server/reference/pipeline-stages/query/recommendation-boosting-query-stage)
* [JDBC Lookup](/docs/4/fusion-server/reference/pipeline-stages/query/jdbc-query-stage)
* [Security Trimming](/docs/4/fusion-server/reference/pipeline-stages/query/security-trimming-query-stage)
* [Solr Subquery](/docs/4/fusion-server/reference/pipeline-stages/query/subquery-query-stage)

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](/docs/4/fusion-server/reference/pipeline-stages/query/merge-async-results-query-stage) at a later point in the pipeline.
