Upstash Documentation

Search

2 min read

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#
Show properties
querystringrequired#

The search query string.

limitintrequired#

The maximum number of results to return. Defaults to 10.

rerankingbool#

Whether to enable AI-powered reranking of results. Disabled by default.

filterstring#

A filter for narrowing down the search results based on content fields.

semantic_weightnumber#

Optional relevance balance between semantic and keyword search (0-1 range, defaults to 0.75). For instance, 0.2 applies 20% semantic matching with 80% full-text matching. You can learn more about how Upstash Search works from our docs.

input_enrichmentboolean#

Optional boolean to enhance queries before searching (enabled by default).

Response#

DocumentsList[DocumentScore]required#

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

Show properties
idstring | numberrequired#

The ID of the resulting document.

contentRecord<string, unknown>#

The main content of the document.

metadataRecord<string, unknown>#

Additional metadata for the document.

scorefloatrequired#

Similarity score of the document