So let's say I'm looking for a "blerg." And I have an element called SomethingblergSomething.
If I do an ILIKE search in postgres (and rails) as follows:
where("name ILIKE ?", "%#{ 'Blerg' }%")
It will return the result of "SomethingBlergSomething" because it contains Blerg.
Is there a way to make a quick tsvector a similar way to search inside a word:
where("(to_tsvector('english', name) @@ to_tsquery(?))", ('Blerg' + ':*'))
The above query will not return "SomethingBlergSomething".
So, how do I get tsvector to act like ILIKE when searching inside words.
source
share