Skip to content

Support indexing tsquery phrases #43

Open
@felixbuenemann

Description

@felixbuenemann

Currently indexing with rum fails, if the tsquery column or expression contains phrases:

ERROR: Indexing of phrase tsqueries isn't supported yet

It would be very useful if this feature was supported, since it would allow to quickly check if a phrase is contained in some text (for example to filter text containing blacklisted phrases).

Activity

obartunov

obartunov commented on Jul 19, 2018

@obartunov
felixbuenemann

felixbuenemann commented on Jul 19, 2018

@felixbuenemann
Author
CREATE TABLE phrases (phrase tsquery);
INSERT INTO phrases (to_tsquery('simple', 'quick <-> red <-> fox'));
CREATE INDEX phrases_idx on phrases using RUM (phrase);
-- ERROR:  Indexing of phrase tsqueries isn't supported yet
self-assigned this
on Jul 19, 2018
akorotkov

akorotkov commented on Jul 19, 2018

@akorotkov
Contributor

The easiest thing, which is possible to do here, is to support phrase operator in the same way as AND operator. That would require to check actual phrase matching using heap tuple during recheck stage. But it appears that our format of additional info didn't have reserved area in order to store whether recheck is needed. I'll investigate what could be done in this area.

felixbuenemann

felixbuenemann commented on Jul 20, 2018

@felixbuenemann
Author

I think a recheck would be perfectly fine. Thanks for looking into it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @felixbuenemann@akorotkov@obartunov@za-arthur

      Issue actions

        Support indexing tsquery phrases · Issue #43 · postgrespro/rum