Skip to content

Docs/add choose retrieval strategy guide#5593

Draft
sanjaruzic wants to merge 8 commits intomainfrom
docs/add-choose-retrieval-strategy-guide
Draft

Docs/add choose retrieval strategy guide#5593
sanjaruzic wants to merge 8 commits intomainfrom
docs/add-choose-retrieval-strategy-guide

Conversation

@sanjaruzic
Copy link

Summary

Add comprehensive guide for choosing a retrieval strategy in Elasticsearch.

This PR adds documentation to help users choose between different retrieval strategies. The guide covers:

  • Full-text search (BM25): for exact-match and keyword queries
  • Semantic search: for conversational and natural language queries
  • Hybrid search: combining BM25 and semantic retrieval with RRF
  • Reranking: second-pass scoring for improved precision

Changes

  • New file: solutions/search/choose-retrieval-strategy.md
  • Navigation: Entry already exists in solutions/toc.yml (line 16)
  • Includes comparison table and decision matrix
  • Links to detailed implementation guides

Generative AI disclosure

Did you use a generative AI (GenAI) tool to assist in creating this contribution?
✅ Yes

Tool(s) and model(s) used:

  • Claude Sonnet 4.6 (Anthropic)
  • ChatGPT Deep Research (OpenAI, model 5.4)

sanjaruzic and others added 4 commits March 9, 2026 15:56
- Add new guide for choosing between retrieval approaches (BM25, semantic, hybrid)
- Covers when to use each strategy and how they compare
- Add navigation entry in toc.yml

Provides guidance for users deciding which retrieval strategy to use for their Elasticsearch search implementation.
- Add comprehensive guide comparing full-text, semantic, hybrid search, and reranking
- Helps users choose the right retrieval approach for their use case
- Includes decision matrix and next steps guidance
- Add navigation entry in toc.yml
Compare full-text, semantic, hybrid search, and reranking approaches
Include decision matrix and resource considerations
Add navigation entry already present in toc.yml

This PR adds documentation to help users choose between different
retrieval strategies in Elasticsearch. The guide covers:

- Full-text search (BM25): for exact-match and keyword queries
- Semantic search: for conversational and natural language queries
- Hybrid search: combining BM25 and semantic retrieval with RRF
- Reranking: second-pass scoring for improved precision

Changes:
- New file: solutions/search/choose-retrieval-strategy.md
- Navigation: Entry already exists in solutions/toc.yml (line 16)

Generative AI disclosure:
Tool(s) and model(s) used:
- Claude Sonnet 4.6 (Anthropic)
- ChatGPT Deep Research (OpenAI, model 5.4)
@github-actions
Copy link
Contributor

github-actions bot commented Mar 23, 2026

✅ Vale Linting Results

No issues found on modified lines!


The Vale linter checks documentation changes against the Elastic Docs style guide.

To use Vale locally or report issues, refer to Elastic style guide for Vale.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Solutions Search documentation page to help users choose between retrieval strategies in Elasticsearch (full-text/BM25, semantic, hybrid, reranking), and wires it into the Search approaches navigation.

Changes:

  • Adds a new guide: choose-retrieval-strategy.md with explanations, a comparison table, and “next steps” links.
  • Updates solutions/toc.yml to include the new page under Search approaches.
  • (Unintended) Alters the Full-text TOC structure around “search relevance” pages due to a removed TOC entry and mis-indented children.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
solutions/toc.yml Adds the new page to navigation, but currently breaks nesting for the existing full-text “search relevance” section.
solutions/search/choose-retrieval-strategy.md New retrieval strategy selection guide; needs table syntax correction and front matter alignment with section conventions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- file: search/full-text.md
children:
- file: search/full-text/how-full-text-works.md
- file: search/full-text/text-analysis-during-search.md
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The TOC nesting looks broken: search/full-text/text-analysis-during-search.md is now given children: that point to search/full-text/search-relevance/*, and the search/full-text/search-relevance.md entry was removed. This will misplace the “Search relevance optimizations” pages in navigation (and likely make search-relevance.md unreachable). Restore the - file: search/full-text/search-relevance.md item and move these children back under it, leaving text-analysis-during-search.md without those children.

Suggested change
- file: search/full-text/text-analysis-during-search.md
- file: search/full-text/text-analysis-during-search.md
- file: search/full-text/search-relevance.md

Copilot uses AI. Check for mistakes.
Comment on lines +80 to +88
| Situation | Recommended approach |
|---|---|
| Queries use specific terms, identifiers, or codes | Full-text |
| Queries are conversational or use natural language | Semantic |
| Mixed query types in the same application | Hybrid |
| You need both exact-match precision and semantic recall | Hybrid |
| You want higher precision over a retrieved candidate set | Add reranking |
| Multilingual corpus, no translation layer | Semantic |

Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comparison table uses || at the start of each row (|| Situation | Recommended approach |), which doesn’t match the table syntax used elsewhere in these docs and will render incorrectly (extra empty column / malformed table). Use standard Markdown table pipes (|) for the header and each row.

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +8
---
navigation_title: Choose a strategy
description: Compare full-text search, semantic search, hybrid search, and reranking to decide which approach fits your use case.
applies_to:
stack: ga
serverless:
elasticsearch: ga
---
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This page’s front matter defines applies_to but omits the products: list that is present in other solutions/search/* pages (for example solutions/search/using-openai-compatible-models.md:1-13 and solutions/search/search-approaches.md:1-12). If the docs build relies on products for filtering/badging, add an appropriate products list here for consistency.

Copilot uses AI. Check for mistakes.
- Restore search-relevance.md as parent entry with correct nesting
- Add products list to front matter for consistency
- Fixes navigation error: 'Could not find Search relevance optimizations'
@github-actions
Copy link
Contributor

github-actions bot commented Mar 23, 2026

🔍 Preview links for changed docs

Copy link
Member

@alaudazzi alaudazzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of editing suggestions, otherwise LGTM.


# Choose a retrieval strategy

Elasticsearch supports several retrieval strategies. This page helps you understand the differences and choose the right approach for your use case.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Elasticsearch supports several retrieval strategies. This page helps you understand the differences and choose the right approach for your use case.
{{es}} supports several retrieval strategies. This page helps you understand the differences and choose the right approach for your use case.

Comment on lines +23 to +26
- **Full-text search**: keyword and lexical matching using BM25
- **Semantic search**: meaning-based matching using vector embeddings
- **Hybrid search**: BM25 and semantic search combined
- **Reranking**: a second-pass scoring step applied on top of retrieval results
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **Full-text search**: keyword and lexical matching using BM25
- **Semantic search**: meaning-based matching using vector embeddings
- **Hybrid search**: BM25 and semantic search combined
- **Reranking**: a second-pass scoring step applied on top of retrieval results
- **Full-text search**: Keyword and lexical matching using BM25
- **Semantic search**: Meaning-based matching using vector embeddings
- **Hybrid search**: BM25 and semantic search combined
- **Reranking**: A second-pass scoring step applied on top of retrieval results

@leemthompo leemthompo marked this pull request as draft March 25, 2026 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants