Skip to content

Add suport for TEXT[] types when creating bm25 index #199

@academiaresf

Description

@academiaresf

Problem Statement

The array_to_string(ARRAY, text, [ text) is not immutable and can't be used as source for indexes.

It's very common to use TEXT[] and not TEXT for large text content because each separation \n represents an element of the array.

Proposed Solution

CREATE INDEX docs_bm25_idx ON docs
USING bm25(array_to_string(content, ' ')) -- working!
WITH (text_config='spanish');

-- OR

CREATE INDEX docs_bm25_idx ON docs
USING bm25(content) -- row as text[]
WITH (text_config='spanish');

Alternatives Considered

Paradedb actually supports the use case.

Additional Context

pg_textsearch v0.5.0
postgresql v18.1

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions