feat(search): swap plainto_tsquery for websearch_to_tsquery#4371
Open
viq wants to merge 1 commit into
Open
Conversation
This switches plainto_tsquery to instead use websearch_to_tsquery, introduced in PostgreSQL 11. With unquoted text it behaves the same, but allows to use quoted text and OR and negation in the search terms.
Collaborator
|
The documentation says that PostgreSQL ≥ 9.5 is required. Maybe it's time to bump this requirement? Debian bullseye (oldoldstable) ships PostgreSQL 13. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This switches plainto_tsquery to instead use websearch_to_tsquery, introduced in PostgreSQL 11. With unquoted text it behaves the same, but allows to use quoted text and OR and negation in the search terms.
Have you followed these guidelines?
To the above checklist: I ran the integrated test suite, including integration tests, and everything passed.
I ran it where I'm figuring out which reader I like more, which has ~300 feeds, but I don't use that much - it does work there, and now I can perform a
something OR other OR evenmoreoptionssearch, and it returns results (they seem to be sorted by relevance more than recency?).On nextflux connected to this miniflux instance, a simple single word search continued to work, but the complex search with
ORdid not.And I will point out that I don't know enough to known the implications of this, I don't know what this can affect and where, and used a simple search-and-replace on the instances of the function. But, this seems to drastically increase functionality of available search.