Skip to content

add the following operations to QdrantDocumentStore #2638

@davidsbatista

Description

@davidsbatista
def count_documents_by_filter(filter: dict) -> int
  • applies a filter and counts the documents that matched it.

def count_unique_metadata_by_filter(filters: dict[str, Any], metadata_fields: list[str]) -> dict[str, int]` 
  • applies a filter selecting documents and counts the unique values for each meta field of the matched documents

def get_metadata_fields_info() -> dict[str, dict]
  • returns the meta fields and the corresponding types, it should return the same format as in the OpenSearchDocumentStore
{
    'content': {'type': 'text'},
    'category': {'type': 'keyword'},
    'status': {'type': 'keyword'},
    'priority': {'type': 'long'},
}

def get_metadata_field_min_max(metadata_field: str) -> dict[str, Any]
  • for a given metadata field, find its max and min value

def get_metadata_field_unique_values(metadata_field: str, search_term: str | None, from_: int, size: int) -> tuple[list[str], int]:
  • retrieves unique values for a field matching a search_term or all possible values if no search term is given

def query_sql(query: str)
  • (optional) issue an SQL query for the doc stores that support it

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions