--- title: Create Your First Index description: Create a ParadeDB index over your table canonical: https://www.paradedb.com/docs/start/create-your-first-index --- Create a ParadeDB index over the `mock_items` table from [Configure Your Environment](/start/configure-your-environment). The same index supports text search, vector search, filtering, sorting, and aggregations in the next page. ```sql 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 ) WITH (key_field='id'); ``` ```ts Drizzle 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 ) WITH (key_field='id') `); ``` ```python Django 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 ) WITH (key_field='id') """) ``` ```python SQLAlchemy 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 ) WITH (key_field='id') """)) ``` ```ruby Rails 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 ) WITH (key_field='id'); SQL ``` ```cs EF Core 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 ) WITH (key_field='id'); """); ``` If `search_idx` already exists, drop it first with `DROP INDEX search_idx;`. The first indexed column, `id`, is also the `key_field`. ParadeDB uses the key field as the row's stable identifier inside the index. In your own schema, use a primary key or another column with a `UNIQUE` constraint. See [Choosing a Key Field](/reference/indexing/create-index#choosing-a-key-field) for the full rules. Everything after `id` is a field you can search, filter, sort, group, or aggregate. 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](/reference/indexing/create-index) reference includes framework-native examples and tokenizer options. Next, [run your first queries](/start/run-queries).