# BM25Retriever

> **Class** in `langchain_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-community/retrievers/bm25/BM25Retriever)

`BM25` retriever without Elasticsearch.

## Signature

```python
BM25Retriever()
```

## Extends

- `BaseRetriever`

## Properties

- `vectorizer`
- `docs`
- `k`
- `preprocess_func`
- `model_config`

## Methods

- [`from_texts()`](https://reference.langchain.com/python/langchain-community/retrievers/bm25/BM25Retriever/from_texts)
- [`from_documents()`](https://reference.langchain.com/python/langchain-community/retrievers/bm25/BM25Retriever/from_documents)

---

[View source on GitHub](https://github.com/langchain-ai/langchain-community/blob/a6a6079511ac8a5c1293337f88096b8641562e77/libs/community/langchain_community/retrievers/bm25.py#L15)