Search code examples
postgresqlfull-text-searchstring-matchingtsvector

Postgres full text search: Word positioning is results


I am trying to figure out how to create TsQuery where when I query "Executive Sales" I get only results that have "Executive Sales" as the first and second word. For example

  • Executive Sales Manager
  • Executive Sales Representative etc.

I have tried with Executive <-> Sales:* but this gives me results like:

  • Account Executive Sales

Solution

  • FTS is the wrong tool for that job.

    col1 LIKE 'Executive Sales%'