Commands

Search

Search Command for Python SDK

The search method is designed to retrieve the most relevant documents from the database, using AI-powered search capabilities.

For more details on how the search algorithm works, please refer to our advanced settings documentation.

Arguments

Payloaddictrequired

Response

DocumentsList[DocumentScore]required

This field is null if no document with the specified ID is found.

Basic Search
results = index.search(    query="space opera",    limit=2)print(results)
Search with Reranking
results = index.search(    query="space opera",    limit=2,    reranking=True)print(results)
Search with Filter
results = index.search(    query="space",     limit=2,     filter="category = 'classic'")print(results)
Loading search…