Upstash Search allows you to partition a single database into multiple isolated indexes. Each index acts as a self-contained subset of the database, search and upsert requests are limited to one index.


Using an Index

Indexes are created implicitly when an upsert operation is performed, so there is no specific endpoint for creating an index.

For example, the code snippet below will create the index foo if it does not already exist, upsert and search the document only on that index.

index = client.index("foo")
index.upsert( ... )

Listing Indexes

Names of all the active indexes of a database can be listed as follows:

client.list_indexes()

Deleting an Index

Leftover indexes can be deleted as follows:

client.delete_index("foo")