lancedb_haystack.fts_retriever
Classes
A component for retrieving documents from an LanceDBDocumentStore using the FTS. |
Module Contents
- class lancedb_haystack.fts_retriever.LanceDBFTSRetriever(document_store: lancedb_haystack.document_store.LanceDBDocumentStore, filters: Dict[str, Any] | None = None, top_k: int | None = 10)
A component for retrieving documents from an LanceDBDocumentStore using the FTS.
- NAME = 'lancedb_haystack.fts_retriever.LanceDBFTSRetriever'
- _document_store
- _filters
- _top_k
- run(query: str, filters: Dict[str, Any] | None = None, top_k: int | None = None)
Run the LanceDBFTSRetriever on the given input data.
- Parameters:
query – The query string for the Retriever.
filters – A dictionary with filters to narrow down the search space.
top_k – The maximum number of documents to return.
- Returns:
The retrieved documents.
- Raises:
ValueError – If the specified DocumentStore is not found or is not a LanceDBFTSRetriever instance.
- to_dict() Dict[str, Any]
Serialize this component to a dictionary.
- classmethod from_dict(data: Dict[str, Any]) LanceDBFTSRetriever
Deserialize this component from a dictionary.