Closed arcreative closed 3 weeks ago
@nertzy Any possibility the parser could recognize quoted phrases when separating search terms? I don't think we need full lucene or anything, but some of the native functions of PG might be nice. Quite a few people at my company are angry at me at the moment since our search functionality is lacking!
@arcreative Hi. Any good news ?
@Ripchanskiy I fixed this issue by creating my own gem. Turns out there’s very little to do in Ruby land if you just spend a little more thought creating your tsv column for fulltext search, including associated records. Mine allows this:
MyModel.search('foo bar "include this phrase" -butnotthis -"and and also not this phrase"')
and is more efficient since you’re doing “pain on write” and not doing tsvector calculations on the fly.
Find it here, and let me know your thoughts! https://github.com/arcreative/pg_fulltext
Apologies if I missed something, but is there support for phrase searches like "business analyst" in the middle of a search string, like the following:
Where the results include word1 or word2 anywhere, but only word2 and word3 in proximity? It looks like this is supported with Postgres'
term & term
orterm <-> term
search, but it looks like the pg_search query parser splits the queries in a more basic way.