> ## 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.

# Getting Started

> Creating an Upstash Search Database

***

<iframe
  id="intro-video"
  width="560"
  height="315"
  src="https://www.youtube.com/embed/xVwdHZEkdGI?rel=0&disablekb=1"
  title="YouTube video player"
  frameBorder="0"
  allow="accelerometer; fullscreen;
clipboard-write; encrypted-media; gyroscope"
  allowFullScreen
/>

***

<Tip href="/redis/search/introduction">
  We now have **[Redis Search](/redis/search/introduction)** in Upstash.

  If you are starting a new project, we recommend using **Redis Search**:

  * Index and query your Redis data with a schema.
  * Use advanced query operators and aggregations.
  * Keep your data and search in one place.

  See [Redis Search Introduction](/redis/search/introduction) for details.
</Tip>

***

## Quickstart

Check out our Next.js quickstart guide if you're working in Next.js.

<CardGroup cols={1}>
  <Card title="Next.js" icon="node-js" href="/search/tutorials/nextjs">
    Use Upstash Search in your Next.js app
  </Card>
</CardGroup>

***

## Create a Database

Create a Search Database by navigating to the `Vector` tab and clicking on the `Search Database` button under `Create`.

<Frame style={{ width: "600px" }}>
  <img src="https://mintcdn.com/upstash/Jptn6phDMqX3vXTS/img/search/create-database.png?fit=max&auto=format&n=Jptn6phDMqX3vXTS&q=85&s=700c3c0281ffdaa7e6050d8701c177d7" width="2112" height="846" data-path="img/search/create-database.png" />
</Frame>

A dialog with the following options will open:

* **Name:** Type a name for your database (e.g. "product-search").

* **Region:** Choose the region for your database. For best performance, select the region closest to your application.

  *We plan to support additional regions and cloud providers. Feel free to send your requests to [support@upstash.com](mailto:support@upstash.com).*

Once you're done, click `Next`, choose a plan, and your Database is ready:

<Frame style={{ width: "600px" }}>
  <img src="https://mintcdn.com/upstash/fy-PVAyWJaRFn1UN/img/search/database-created.png?fit=max&auto=format&n=fy-PVAyWJaRFn1UN&q=85&s=1f1c586699ca58c64c9d1359343ab858" width="1414" height="955" data-path="img/search/database-created.png" />
</Frame>

***

## Add Documents

Add documents to your database using our REST API, our SDKs, or directly in the dashboard.

### 1. Add Documents via Dashboard

Navigate to the `Data Browser` section of your Database and click `Upsert Documents`:

<Frame style={{ width: "600px" }}>
  <img src="https://mintcdn.com/upstash/fy-PVAyWJaRFn1UN/img/search/add-data.png?fit=max&auto=format&n=fy-PVAyWJaRFn1UN&q=85&s=e7f4bb618858c4428ebb0a64fc92dc64" width="1427" height="955" data-path="img/search/add-data.png" />
</Frame>

A dialog with the following options will open:

<Frame style={{ width: "600px" }}>
  <img src="https://mintcdn.com/upstash/fy-PVAyWJaRFn1UN/img/search/add-document.png?fit=max&auto=format&n=fy-PVAyWJaRFn1UN&q=85&s=887b8edefbc6f605aa7ef500f7dddd0c" width="1409" height="956" data-path="img/search/add-document.png" />
</Frame>

* **Index:** An [index](/search/features/indexes) to group your data.

  *If you plan to query all documents in one place, you only need one index (e.g. "product-search"). If you plan to add multi-tenancy, so that each user can only search their own data, for example, you can create one index per user ("user-1", "user-2", etc.).*

* **ID:** An automatically generated ID.

* **Content:** The searchable data in JSON format.

* **Metadata:** Optional information attached to this document.

More information about content and metadata can be found [here](/search/features/content-and-metadata).

***

### 2. Add Documents via SDKs

<Tabs>
  <Tab title="Python">
    ```python theme={"system"}
    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",
                },
            },
        ],
    )
    ```
  </Tab>

  <Tab title="TypeScript">
    ```ts theme={"system"}
    import { Search } from "@upstash/search"

    const client = new Search({
      url: "<SEARCH_INDEX_REST_URL>",
      token: "<SEARCH_INDEX_REST_TOKEN>",
    })

    const index = client.index("movies")

    await index.upsert([
      {
        id: "star-wars",
        content: { title: "Star Wars", genre: "sci-fi", category: "classic" },
        metadata: { director: "George Lucas" },
      },
    ])
    ```
  </Tab>
</Tabs>

***

## Search Your Database

You can search across your Database the same way: using our REST API, our SDKs or directly in your dashboard.

### 1. Searching via Dashboard

To search your documents, enter a search term and click `Search`:

<Frame style={{ width: "600px" }}>
  <img src="https://mintcdn.com/upstash/fy-PVAyWJaRFn1UN/img/search/first-search.png?fit=max&auto=format&n=fy-PVAyWJaRFn1UN&q=85&s=3575f960b55c3c9f222f8ae28cd4cb9f" width="1447" height="959" data-path="img/search/first-search.png" />
</Frame>

### 2. Searching Data via SDKs

<Tabs>
  <Tab title="Python">
    ```py theme={"system"}
    scores = index.search( query="space opera", limit=2, )
    ```
  </Tab>

  <Tab title="TypeScript">
    ```ts theme={"system"}
    const searchResults = await index.search({
      query: "space opera",
      limit: 2,
      reranking: true,
    });
    ```
  </Tab>
</Tabs>

***

**That's it!** 🎉 You've just created your first serverless search database with Upstash Search!

But this is just the beginning. Upstash Search also supports:

* Advanced reranking
* Fine-grained control over search results
* Metadata-based filtering

We'll get into those features in the next sections of this documentation. For now, you've already mastered the basics!
