Commands

Upsert

Upsert Command for Python SDK

Used to add new documents or update an existing document.

Arguments

DocumentsList[Document]required
from upstash_search import Searchclient = 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",            },        },    ],)
Loading search…