Skip to main content

WeaviateBM25Retriever

A component for retrieving documents from Weaviate using the BM25 algorithm.

Basic Information

  • Type: haystack_integrations.components.retrievers.weaviate.bm25_retriever.WeaviateBM25Retriever

Inputs

ParameterTypeDefaultDescription
querystrThe query text.
filtersOptional[Dict[str, Any]]NoneFilters applied to the retrieved Documents. The way runtime filters are applied depends on the filter_policy chosen at retriever initialization. See init method docstring for more details.
top_kOptional[int]NoneThe maximum number of documents to return.

Outputs

ParameterTypeDefaultDescription
documentsList[Document]

Overview

Work in Progress

Bear with us while we're working on adding pipeline examples and most common components connections.

A component for retrieving documents from Weaviate using the BM25 algorithm.

Example usage:

from haystack_integrations.document_stores.weaviate.document_store import WeaviateDocumentStore
from haystack_integrations.components.retrievers.weaviate.bm25_retriever import WeaviateBM25Retriever

document_store = WeaviateDocumentStore(url="http://localhost:8080")
retriever = WeaviateBM25Retriever(document_store=document_store)
retriever.run(query="How to make a pizza", top_k=3)

Usage Example

components:
WeaviateBM25Retriever:
type: weaviate.src.haystack_integrations.components.retrievers.weaviate.bm25_retriever.WeaviateBM25Retriever
init_parameters:

Parameters

Init Parameters

These are the parameters you can configure in Pipeline Builder:

ParameterTypeDefaultDescription
document_storeWeaviateDocumentStoreInstance of WeaviateDocumentStore that will be used from this retriever.
filtersOptional[Dict[str, Any]]NoneCustom filters applied when running the retriever
top_kint10Maximum number of documents to return
filter_policyUnion[str, FilterPolicy]FilterPolicy.REPLACEPolicy to determine how filters are applied.

Run Method Parameters

These are the parameters you can configure for the component's run() method. This means you can pass these parameters at query time through the API, in Playground, or when running a job. For details, see Modify Pipeline Parameters at Query Time.

ParameterTypeDefaultDescription
querystrThe query text.
filtersOptional[Dict[str, Any]]NoneFilters applied to the retrieved Documents. The way runtime filters are applied depends on the filter_policy chosen at retriever initialization. See init method docstring for more details.
top_kOptional[int]NoneThe maximum number of documents to return.