> ## Documentation Index
> Fetch the complete documentation index at: https://www.paradedb.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Your First Index

> Create a ParadeDB index over your table

Create a ParadeDB index over the `mock_items` table from [Configure Your
Environment](https://www.paradedb.com/docs/start/configure-your-environment.md). The same index supports text
search, vector search, filtering, sorting, and aggregations in the next page.

```sql SQL theme={null}
CREATE INDEX search_idx ON mock_items
USING paradedb (
  id,
  description,
  embedding vector_cosine_ops,
  category,
  rating,
  in_stock,
  created_at,
  last_updated_date,
  latest_available_time,
  metadata,
  weight_range
);
```

```ts Drizzle theme={null}
import { sql } from "drizzle-orm";

await db.execute(sql`
  CREATE INDEX search_idx ON mock_items
  USING paradedb (
    id,
    description,
    embedding vector_cosine_ops,
    category,
    rating,
    in_stock,
    created_at,
    last_updated_date,
    latest_available_time,
    metadata,
    weight_range
  )
`);
```

```python Django theme={null}
from django.db import connection

with connection.cursor() as cursor:
    cursor.execute("""
        CREATE INDEX search_idx ON mock_items
        USING paradedb (
          id,
          description,
          embedding vector_cosine_ops,
          category,
          rating,
          in_stock,
          created_at,
          last_updated_date,
          latest_available_time,
          metadata,
          weight_range
        )
    """)
```

```python SQLAlchemy theme={null}
from sqlalchemy import text

with engine.begin() as conn:
    conn.execute(text("""
        CREATE INDEX search_idx ON mock_items
        USING paradedb (
          id,
          description,
          embedding vector_cosine_ops,
          category,
          rating,
          in_stock,
          created_at,
          last_updated_date,
          latest_available_time,
          metadata,
          weight_range
        )
    """))
```

```ruby Rails theme={null}
ActiveRecord::Base.connection.execute <<~SQL
  CREATE INDEX search_idx ON mock_items
  USING paradedb (
    id,
    description,
    embedding vector_cosine_ops,
    category,
    rating,
    in_stock,
    created_at,
    last_updated_date,
    latest_available_time,
    metadata,
    weight_range
  );
SQL
```

```cs EF Core theme={null}
await dbContext.Database.ExecuteSqlRawAsync("""
    CREATE INDEX search_idx ON mock_items
    USING paradedb (
      id,
      description,
      embedding vector_cosine_ops,
      category,
      rating,
      in_stock,
      created_at,
      last_updated_date,
      latest_available_time,
      metadata,
      weight_range
    );
    """);
```

> [!NOTE]
>
> If `search_idx` already exists, drop it first with `DROP INDEX search_idx;`.

Every indexed column is a field you can search, filter, sort, group, or
aggregate. The `key_field` index option is deprecated and ignored.

The `description` column is indexed for full-text search, `embedding`
is indexed for vector search, and fields like `rating`, `category`, and
`created_at` are available for filters, Top K queries, and facets.

For production schemas, define this index in your migration system instead of
running ad hoc SQL. The full [Create an
Index](https://www.paradedb.com/docs/reference/indexing/create-index.md) reference includes framework-native
examples and tokenizer options.

Next, [run your first queries](https://www.paradedb.com/docs/start/run-queries.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.