Documentation Index
Fetch the complete documentation index at: https://upstash.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Upsert Command for Python SDK
Used to add new documents or update an existing document.
Arguments
The unique identifier for the document.
The main content of the document.
Additional metadata for the document.
from upstash_search import Search
client = Search(
url="<UPSTASH_SEARCH_REST_URL>",
token="<UPSTASH_SEARCH_REST_TOKEN>",
)
index = client.index("movies")
index.upsert(
documents=[
{
"id": "movie-0",
"content": {
"title": "Star Wars",
"overview": "Sci-fi space opera",
"genre": "sci-fi",
"category": "classic",
},
"metadata": {
"poster": "https://poster.link/starwars.jpg",
},
},
],
)