> ## 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 Data Flow

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-dataflow

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

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

[Indexing Data Flow](/docs/5/fusion/intro/indexing-dataflow) shows you how your content, signals, and recommendations are indexed in Fusion. This topic explains how to query your indexed data.

<LwTemplate />

## 1. Query your content

When you query your content using the default query pipeline *and* you have [signals enabled](/docs/5/fusion/intro/indexing-dataflow), you also get [query rewrites](/docs/5/fusion/getting-data-out/query-enhancement/query-rewriting) and [automatic boosting](/docs/5/fusion/getting-data-out/query-enhancement/boosting/boost-with-signals) to enhance the relevancy of your search results. In addition to matches from your primary collection, you’ll get results produced by Fusion’s machine learning jobs, based on [signals](/docs/5/fusion/getting-data-out/query-enhancement/signals/overview) from your users.

[Query profiles](/docs/5/fusion/getting-data-out/query-basics/query-pipelines/query-profiles) give you a stable endpoint that can be associated with any [query pipeline](/docs/5/fusion/getting-data-out/query-basics/query-pipelines/overview). Just specify the query profile when sending queries to the [Query Profiles API](/api-reference/query-profiles-api/get-the-service-status) endpoint. You can always reconfigure the query profile to point to a different pipeline, or to an [experiment](/docs/5/fusion/getting-data-out/data-analytics/experiments/overview).

<Frame caption="Querying your content">
  <img src="https://mintcdn.com/lucidworks/tklssWuUmNaxlF0b/assets/images/5.4/diagrams/primary-query.png?fit=max&auto=format&n=tklssWuUmNaxlF0b&q=85&s=ed0d221fac5604cdd3681e54b02417ed" alt="Query your content" width="1212" height="1128" data-path="assets/images/5.4/diagrams/primary-query.png" />
</Frame>

* Several stages perform [query rewriting](/docs/5/fusion/getting-data-out/query-enhancement/query-rewriting) and [response rewriting](/docs/5/fusion/getting-data-out/query-enhancement/response-rewriting) by reading from the `_query_rewrite` collection:

  * The [Text Tagger stage](/docs/5/fusion/reference/config-ref/pipeline-stages/query-stages/text-tagger-query-stage) finds [misspellings](/docs/5/fusion/getting-data-out/query-enhancement/misspelling-detection), [phrases](/docs/5/fusion/getting-data-out/query-enhancement/phrase-detection), [underperforming query strings](/docs/5/fusion/getting-data-out/query-enhancement/underperforming-queries), and [synonyms](/docs/5/fusion/reference/config-ref/jobs/synonym-detection) in the incoming query.
  * The [Apply Rules stage](/docs/5/fusion/reference/config-ref/pipeline-stages/query-stages/query-rules-query-stage) applies your [business rules](/docs/5/fusion/getting-data-out/query-enhancement/business-rules/overview) to the incoming query.
  * The [Modify Response with Rules stage](/docs/5/fusion/reference/config-ref/pipeline-stages/query-stages/rules-augment-response-query-stage)
* The [Boost with Signals stage](/docs/5/fusion/reference/config-ref/pipeline-stages/query-stages/recommendation-boosting-query-stage) reads aggregated signals to boost search results that have been popular with users.
* The [Solr Query stage](/docs/5/fusion/reference/config-ref/pipeline-stages/query-stages/solr-query-stage) fetches the final set of relevant search results from the primary collection.

## 2. Query for recommendations

To get even more relevant results based on AI-powered analysis of your signals data, your query pipeline can perform any number of secondary queries to the collections where the output from machine learning jobs is indexed. Your secondary queries can provide additional search results based on Fusion’s analysis of your signals.

<Frame caption="Querying for recommendations">
  <img src="https://mintcdn.com/lucidworks/tklssWuUmNaxlF0b/assets/images/5.4/diagrams/secondary-query.png?fit=max&auto=format&n=tklssWuUmNaxlF0b&q=85&s=7b5d62fef33d4815f69f01d739d5d1b7" alt="Query your recommendations" width="1312" height="1232" data-path="assets/images/5.4/diagrams/secondary-query.png" />
</Frame>

* Use the [Recommend Items for Item stage](/docs/5/fusion/reference/config-ref/pipeline-stages/query-stages/recommend-items-for-item-query-stage) to query for [collaborative items-for-item recommendations](/docs/5/fusion/getting-data-out/query-enhancement/recommendations/items-for-item#collaborative-items-for-item-recommendations).
* The [Recommend Items for User stage](/docs/5/fusion/reference/config-ref/pipeline-stages/query-stages/recommend-items-for-user-query-stage) queries for [items-for-user recommendations](/docs/5/fusion/getting-data-out/query-enhancement/recommendations/items-for-user).
* The [Recommend Similar Queries stage](/docs/5/fusion/reference/config-ref/pipeline-stages/query-stages/recommend-similar-queries-query-stage) provides [queries-for-query recommendations](/docs/5/fusion/getting-data-out/query-enhancement/recommendations/queries-for-query).
