Skip to main content
A retriever runs one or more queries and returns the top documents. Queries describe which documents match. Retrievers decide how those documents are found and ranked.

Available Retrievers

Where to Use Retrievers

A retriever must be the only key of its object. You can use it in two places: A retriever cannot be used inside a query, such as inside $must, $should, $mustNot, or an $ann filter. $rrf cannot be used inside another $rrf.

Query Options

Some SEARCH.QUERY options do not work with retrievers: $standard at the root supports all options, the same as a plain query.

Counting and Aggregations

SEARCH.COUNT and SEARCH.AGGREGATE accept $rrf when it has no $ann retriever. They use every document that matches any of the queries. window and weight do not apply, so the count can be larger than the number of results SEARCH.QUERY returns. SEARCH.COUNT and SEARCH.AGGREGATE do not support $ann.