> For the complete documentation index, see [llms.txt](https://www.mlcompendium.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.mlcompendium.com/natural-language-processing-nlp/search.md).

# SEARCH

Search over text breaks when the words in the query do not match the words in the document. The page starts with a BERT-based search engine that matches meaning instead of tokens, then lists the recurring semantic-search problems and the fixes for each.

The same notes are in [RAG](/generative-ai/rag.md), [Vector databases](/data/engineering-intro/lakes-and-warehouses.md#vector-databases), and [VECTOR SIMILARITY SEARCH](/deep-learning/representations.md#vector-similarity-search).

The concrete example is a Bert [search engine](https://medium.com/data-science/covid-19-bert-literature-search-engine-4d06cdac08bd) built to organize the fast-growing pile of COVID-19 research papers. Bert cosine between paragraphs and question is the whole ranking step: embed both, and return the paragraphs closest to the question.

A single embedding model is only one piece of a search system. The rest of the system is semantic search, auto completion, filtering, augmentation, and scoring. The problems it has to handle are token matching, contextualization, query misunderstanding, image search, and the metric. The solutions are synonym generation, query autocompletion, alternate query generation, word and doc embedding, contextualization, ranking, ensemble, and multilingual search.

## Deprecated links

{% hint style="warning" %}
These links and images no longer work. The original wording is kept here. A same-resource copy, when one was checked, is used above.
{% endhint %}

* **Bert** search engine\*\*, cosine between paragraphs and question.\*\* This address no longer opens: <https://towardsdatascience.com/covid-19-bert-literature-search-engine-4d06cdac08bd>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.mlcompendium.com/natural-language-processing-nlp/search.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
