Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support indexing tsquery phrases #43

Open
felixbuenemann opened this issue Jul 19, 2018 · 4 comments
Open

Support indexing tsquery phrases #43

felixbuenemann opened this issue Jul 19, 2018 · 4 comments
Assignees

Comments

@felixbuenemann
Copy link

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).

@obartunov
Copy link

obartunov commented Jul 19, 2018 via email

@felixbuenemann
Copy link
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

@akorotkov akorotkov self-assigned this Jul 19, 2018
@akorotkov
Copy link
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
Copy link
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
Projects
None yet
Development

No branches or pull requests

4 participants