Skip to main content
This is a beta feature available in versions 0.22.0 and above.
Postgres allows a maximum of 32 columns in an index definition, but because ParadeDB benefits from pushing filters and ranking signals into the BM25 index this can become a limitation. To index more than 32 columns in a single BM25 index, wrap columns in a ROW() expression cast to a composite type. ParadeDB will unpack the composite type and index each field individually.

Creating a Composite Type

First, define a composite type whose field names and types match the columns you want to index:
Then reference the columns in a ROW() expression cast to the composite type:
Each field in the composite type is indexed as if it were a standalone column. Queries use the field names directly with the standard operators:

Configuring Tokenizers

Fields in the composite type can use tokenizers and token filters by specifying them as the field type:

Constraints

The following are not supported and will produce an error:
  • Anonymous ROW expressions: ROW(a, b) without a type cast is not allowed. Always cast to a named composite type.
  • Nested composites: A composite type cannot contain another composite type as a field.
  • Duplicate field names: Field names must be unique within a single BM25 index, across all composite types and regular columns in that index.