Let's say I get the following table when I do
select name, alternative_name from persons;
name | alternative_name
--------------------------+----------------------------------
Johnny A | John the first
Johnny B | The second John
Now with this query
select name from persons where to_tsvector(name || alternative_name) @@ to_tsquery('John');:
name | alternative_name
--------------------------+----------------------------------
Johnny A | John the first
Shouldn't I get both? How can I do a full text search on both the name and columns where I get all rows that match the search query?
Edit: Yes, there is indeed a typo here. It is to_tsquery
to_tsqueryinstead ofto_query? And you really should add a space so that you don't miss words because of concatenation.