Skip to main content
Before a table can be queried by ParadeDB, it must be indexed. ParadeDB uses a custom index type called the ParadeDB index. The following code block creates a ParadeDB index over several columns in the mock_items table.
The key_field index option is deprecated and ignored. It is still accepted for backward compatibility. New indexes do not require a designated key field or a unique first column.
In version 0.25.0, the BM25 index was renamed to the ParadeDB index, and paradedb was added as the index access method name. The rename reflects the fact that the index is now much more than BM25 scoring — it also powers vector search, aggregates, top K, and filtering. USING bm25 remains supported as a backwards-compatible alias for USING paradedb.
These examples require ParadeDB 0.26.0 or newer and the ORM client versions listed in the getting started guide.
You’ll need to drop the existing search_idx before you can create a new one:
By default, text columns are tokenized using the unicode tokenizer, which splits text according to the Unicode segmentation standard. Because index creation is a time-consuming operation, we recommend experimenting with the available tokenizers to find the most suitable one before running CREATE INDEX. For instance, if a column contains multiple languages, the ICU tokenizer may be more appropriate.
Only one ParadeDB index can exist per table. We recommend indexing all columns in a table that may be present in a search query, including columns used for sorting, grouping, filtering, and aggregations.
Most ordinary scalar columns can be added directly to a ParadeDB index. The separate indexing pages cover cases that need extra configuration, such as JSON, arrays, composite fields, expressions, vectors, and text fields that need columnar storage.

Tracking Create Index Progress

To monitor the progress of a long-running CREATE INDEX, open a separate Postgres connection and query pg_stat_progress_create_index:
Comparing blocks_done to blocks_total will provide a good approximation of the progress so far. If blocks_done equals blocks_total, that means that all rows have been indexed and the index is being flushed to disk.

Index Partitioning (Beta)

To speed up filtered queries by skipping non-matching segments or accelerate parallel joins between tables, you can configure the partition_by option:
See the Partitioning Guide for column selection guidance, data type requirements, and join setup.

Token Filters

After tokens are created, token filters can be configured to apply further processing like lowercasing, stemming, or unaccenting. For example, the following code block adds English stemming to description:

BM25 Parameters

Tuning BM25 parameters is not necessary for most use cases.
BM25 uses two parameters, k1 and b, to control how term frequency and field length affect relevance scores. You can configure them independently for each field when creating an index. Pass k1 and b as options to a field’s tokenizer. In this example, the description field uses lower values to reduce the influence of repeated terms and field length. The category field gives repeated terms more weight while keeping the default length normalization.
You can set either parameter on its own or both together. Omitted parameters keep their defaults, and queries automatically use the values configured in the index.