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:CREATE INDEX.
For instance, if a column contains multiple languages, the ICU tokenizer may be more appropriate.
Tracking Create Index Progress
To monitor the progress of a long-runningCREATE INDEX, open a separate Postgres connection and query pg_stat_progress_create_index:
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 thepartition_by option:
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 todescription:
BM25 Parameters
Tuning BM25 parameters is not necessary for most use cases.
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.