Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions docs/reference/search/search-your-data/retrievers-examples.asciidoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[[retrievers-examples]]
==== Retrievers examples
=== Retrievers examples

To show the full functionality, for this set of examples, we'll assume that we have access to a <<semantic-reranking-models,reranker model>> through the inference service.

Expand Down Expand Up @@ -95,8 +95,8 @@ POST /retrievers_example/_doc/5
Now that we also have our documents in place, let's try to run some queries using retrievers.

[discrete]
[[combining-standard-knn-retrievers-with-rrf]]
===== Combining query and kNN with RRF
[[retrievers-examples-combining-standard-knn-retrievers-with-rrf]]
==== Combining query and kNN with RRF

First, let's examine how to combine two different types of queries: a `kNN` query and a
`query_string` query. While these queries may produce scores in different ranges, we can use
Expand Down Expand Up @@ -147,8 +147,8 @@ GET /retrievers_example/_search
//NOTCONSOLE

[discrete]
[[collapsing-retriever-results]]
===== Grouping results by year with `collapse`
[[retrievers-examples-collapsing-retriever-results]]
==== Grouping results by year with `collapse`

In our result set, we have many documents with the same `year` value. We can clean this
up using the `collapse` parameter with our retriever. This enables grouping results by
Expand Down Expand Up @@ -202,8 +202,8 @@ GET /retrievers_example/_search
//NOTCONSOLE

[discrete]
[[text-similarity-reranker-on-top-of-rrf]]
===== Rerank results of RRF retriever
[[retrievers-examples-text-similarity-reranker-on-top-of-rrf]]
==== Rerank results of an RRF retriever

Previously, we used a `text_similarity_reranker` retriever within an `rrf` retriever.
Because retrievers support full composability, we can also rerank the results of an
Expand Down Expand Up @@ -257,8 +257,8 @@ GET retrievers_example/_search
//NOTCONSOLE

[discrete]
[[rrf-ranking-on-text-similarity-reranker-results]]
===== RRF with semantic reranker
[[retrievers-examples-rrf-ranking-on-text-similarity-reranker-results]]
==== RRF with semantic reranker

For this example, we'll replace our semantic query with the `my-rerank-model`
reranker we previously configured. Since this is a reranker, it needs an initial pool of
Expand Down Expand Up @@ -313,8 +313,8 @@ GET /retrievers_example/_search
//NOTCONSOLE

[discrete]
[[chaining-text-similarity-reranker-retrievers]]
===== Chaining multiple semantic rerankers
[[retrievers-examples-chaining-text-similarity-reranker-retrievers]]
==== Chaining multiple semantic rerankers

Full composability means we can chain together multiple retrievers of the same type. For instance, imagine we have a computationally expensive reranker that's specialized for AI content. We can rerank the results of a `text_similarity_reranker` using another `text_similarity_reranker` retriever. Each reranker can operate on different fields and/or use different inference services.

Expand Down Expand Up @@ -365,8 +365,8 @@ pick the top 10 results and rerank them using the more fine-grained
`my-other-more-expensive-rerank-model`.

[discrete]
[[rrf-and-aggregations]]
===== Combine RRF with aggregations
[[retrievers-examples-rrf-and-aggregations]]
==== Combine RRF with aggregations

Retrievers support both composability and most of the standard `_search` functionality. For instance,
we can compute aggregations with the `rrf` retriever. When using a compound retriever,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[[retrievers-overview]]
=== Retrievers
== Retrievers

A retriever is an abstraction that was added to the Search API in *8.14.0* and was made generally available in *8.16.0*.
This abstraction enables the configuration of multi-stage retrieval pipelines within a single `_search` call.
Expand All @@ -11,7 +11,7 @@ For implementation details, including notable restrictions, check out the

[discrete]
[[retrievers-overview-types]]
==== Retriever types
=== Retriever types

Retrievers come in various types, each tailored for different search operations.
The following retrievers are currently available:
Expand All @@ -34,7 +34,8 @@ Used for <<semantic-reranking,semantic reranking>>.
Requires first creating a `rerank` task using the <<put-inference-api,{es} Inference API>>.

[discrete]
==== What makes retrievers useful?
[[retrievers-overview-why-are-they-useful]]
=== What makes retrievers useful?

Here's an overview of what makes retrievers useful and how they differ from regular queries.

Expand Down Expand Up @@ -66,7 +67,7 @@ When using compound retrievers, only the query element is allowed, which enforce

[discrete]
[[retrievers-overview-example]]
==== Example
=== Example

The following example demonstrates how using retrievers simplify the composability of queries for RRF ranking.

Expand Down Expand Up @@ -149,7 +150,7 @@ For more examples on how to use retrievers, please refer to <<retrievers-example

[discrete]
[[retrievers-overview-glossary]]
==== Glossary
=== Glossary

Here are some important terms:

Expand All @@ -168,7 +169,7 @@ Special compound retrievers that reorder hits and may adjust the number of hits,

[discrete]
[[retrievers-overview-play-in-search]]
==== Retrievers in action
=== Retrievers in action

The Search Playground builds Elasticsearch queries using the retriever abstraction.
It automatically detects the fields and types in your index and builds a retriever tree based on your selections.
Expand All @@ -179,7 +180,7 @@ Refer to the {kibana-ref}/playground.html[Playground documentation] for more inf

[discrete]
[[retrievers-overview-api-reference]]
==== API reference
=== API reference

For implementation details, including notable restrictions, check out the <<retriever,reference documentation>> in the Search API docs.

Expand Down
1 change: 0 additions & 1 deletion docs/reference/search/search-your-data/search-api.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -530,5 +530,4 @@ include::retrieve-inner-hits.asciidoc[]
include::search-shard-routing.asciidoc[]
include::search-using-query-rules.asciidoc[]
include::search-template.asciidoc[]
include::retrievers-overview.asciidoc[]

Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ DSL, with a simplified user experience. Create search applications based on your
results directly in the Kibana Search UI.

include::search-api.asciidoc[]
include::retrievers-overview.asciidoc[]
include::knn-search.asciidoc[]
include::semantic-search.asciidoc[]
include::search-across-clusters.asciidoc[]
Expand Down