indexers.dataclasses.VectorStoreSearchOutput
indexers.dataclasses.VectorStoreSearchOutput(data)DataFrame-like object for storing and validating search results.
This class represents the output of vector store search operations, containing query information, matched documents, scores, and similarity rankings.
Attributes
| Name | Type | Description |
|---|---|---|
| query_id | pd.Series | Identifier for the source query. |
| query_text | pd.Series | The original query text. |
| doc_label | pd.Series | Identifier for the retrieved document. |
| doc_text | pd.Series | The text content of the retrieved document. |
| rank | pd.Series | The ranking position of the result (0-indexed, non-negative). |
| score | pd.Series | The similarity score or relevance metric. |
Methods
| Name | Description |
|---|---|
| from_data | Create a validated VectorStoreSearchOutput from a dictionary or DataFrame. |
| validate | Validate an existing DataFrame and return a VectorStoreSearchOutput. |
from_data
indexers.dataclasses.VectorStoreSearchOutput.from_data(data)Create a validated VectorStoreSearchOutput from a dictionary or DataFrame.
Creates a new instance of VectorStoreSearchOutput by validating the input data against the defined schema.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| data | dict | pd.DataFrame | A dictionary or pandas DataFrame containing the input data. Must include ‘query_id’, ‘query_text’, ‘doc_label’, ‘doc_text’, ‘rank’, and ‘score’ columns/keys. | required |
Returns
| Name | Type | Description |
|---|---|---|
| VectorStoreSearchOutput | VectorStoreSearchOutput | A validated instance of the class. |
validate
indexers.dataclasses.VectorStoreSearchOutput.validate(df)Validate an existing DataFrame and return a VectorStoreSearchOutput.
Validates the provided pandas DataFrame against the defined schema and returns a new instance of VectorStoreSearchOutput if validation is successful.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| df | pd.DataFrame | A pandas DataFrame to validate. Must include ‘query_id’, ‘query_text’, ‘doc_label’, ‘doc_text’, ‘rank’, and ‘score’ columns. | required |
Returns
| Name | Type | Description |
|---|---|---|
| VectorStoreSearchOutput | VectorStoreSearchOutput | A validated instance of the class. |