Do postgres full-text search (tsvector) act like ILIKE to search inside words?

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.

+4
source share
1 answer

, pg_trgm? , .

(GIN GiST) ILIKE . Postgres 9.1+.

:

+6

All Articles