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

# Reverse search

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/lucidworks-search/04-move-data-in/index-pipeline/reverse-search

[mintlify link]: https://doc.lucidworks.com/docs/lucidworks-search/04-move-data-in/index-pipeline/reverse-search

[old doc.lw link]: https://doc.lucidworks.com/managed-fusion/5.9/tba5x3

Reverse search is a feature that promotes document awareness and helps circulate knowledge throughout an organization by matching documents to saved queries upon ingestion. Reverse search tests saved queries against all documents passing through an indexing pipeline to distinguish what document is a match.

<LwTemplate />

For more information, see [Reverse search index stage](/docs/lucidworks-search/09-developer-documentation/config-specs/index-pipeline-stages/reverse-search-index) and [Reverse search query index stage](/docs/lucidworks-search/09-developer-documentation/config-specs/index-pipeline-stages/reverse-search-query).

<Note>
  This feature can be enabled by your Lucidworks representative.
</Note>

Reverse search works by saving queries and running newly indexed documents against them. For example, when you perform a query like this:

```sh wrap  theme={"dark"}
curl -u USERNAME:PASSWORD -X POST "https://EXAMPLE_COMPANY.b.lucidworks.cloud/api/index-pipelines/rev-query-index/collections/fusion-rev-queries/index?echo=true"
```

The response looks like this:

```json wrap  theme={"dark"}
[
    {
        "id": "qadsymwsiu-99",
        "company_s": "Zzz",
        "analyst_s": "",
        "q": "topics_ss:Analyst_Pulse topics_ss:Buy topics_ss:Equity_Research topics_ss:Rating_Change topics_ss:Rating_Reward_Change topics_ss:Sell"
    },
    {
        "id": "mktdnkpgyh-100086",
        "company_s": "Abz",
        "analyst_s": "",
        "q": "topics_ss:\"Price_Target_Change Rating_Change\""
    },
    {
        "id": "upwsspqrcm-1200022",
        "company_s": "",
        "analyst_s": "John_Doe",
        "q": "topics_ss:Buy topics_ss:Credit_Change topics_ss:Price_Target"
    }
]
```

And then when you index new documents in your configured index pipelines:

```sh wrap  theme={"dark"}
curl -u USERNAME:PASSWORD -X POST "https://EXAMPLE_COMPANY.b.lucidworks.cloud/api/index-pipelines/app/collections/app/index?echo=true"
```

The response looks like this:

```json wrap  theme={"dark"}
[
    {
        "id": "sample",
        "analyst_s": "John_Doe",
        "language_s": "en",
        "company_s": "",
        "topics_ss": [
            "Buy",
            "Equity_Research",
            "Rating_Reward_Change"
        ]
    }
]
```

When reverse search is enabled and configured, the `echo=true parameter` contains the following:

```json wrap  theme={"dark"}
{
    "name": "reverse-search-result",
    "value": [
        "java.util.ArrayList",
        [
            "upwsspqrcm-1200022"
        ]
    ],
    "metadata": {},
    "annotations": []
},
```
