RankedDocumentStorage
Represents a specialization of the DocumentStorage interface that handles ranking documents based on their relevance to a given query. The ranking process returns documents along with a similarity score, enabling the filtering and sorting of documents by relevance.
Parameters
The type of the documents being processed and stored.
Functions
Iterates over the documents
Iterates through documents and their corresponding payloads
Retrieves the payload associated with the document identified by the given document ID.
Retrieves the most relevant documents matching the provided query, ranked by their similarity scores in descending order. Only documents with a similarity score greater than or equal to the specified similarity threshold are included, and the result set is limited to the specified count.
Ranks documents in the storage based on their relevance to the given query. Each document is assigned a similarity score that represents how closely it matches the query.
Reads a document along with its associated payload based on the given document ID.