mirror of
https://github.com/hwchase17/langchain
synced 2024-10-29 17:07:25 +00:00
87e502c6bc
Co-authored-by: jacoblee93 <jacoblee93@gmail.com> Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
25 lines
1.3 KiB
Plaintext
25 lines
1.3 KiB
Plaintext
# Elasticsearch
|
|
|
|
>[Elasticsearch](https://www.elastic.co/elasticsearch/) is a distributed, RESTful search and analytics engine.
|
|
> It provides a distributed, multi-tenant-capable full-text search engine with an HTTP web interface and schema-free
|
|
> JSON documents.
|
|
|
|
|
|
## Installation and Setup
|
|
|
|
```bash
|
|
pip install elasticsearch
|
|
```
|
|
|
|
## Retriever
|
|
|
|
>In information retrieval, [Okapi BM25](https://en.wikipedia.org/wiki/Okapi_BM25) (BM is an abbreviation of best matching) is a ranking function used by search engines to estimate the relevance of documents to a given search query. It is based on the probabilistic retrieval framework developed in the 1970s and 1980s by Stephen E. Robertson, Karen Spärck Jones, and others.
|
|
|
|
>The name of the actual ranking function is BM25. The fuller name, Okapi BM25, includes the name of the first system to use it, which was the Okapi information retrieval system, implemented at London's City University in the 1980s and 1990s. BM25 and its newer variants, e.g. BM25F (a version of BM25 that can take document structure and anchor text into account), represent TF-IDF-like retrieval functions used in document retrieval.
|
|
|
|
See a [usage example](/docs/modules/data_connection/retrievers/integrations/elastic_search_bm25.html).
|
|
|
|
```python
|
|
from langchain.retrievers import ElasticSearchBM25Retriever
|
|
```
|