Text search prefix matching and stop words

From: "Matthew Nelson" <mnelson(at)binarykeep(dot)com>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Text search prefix matching and stop words
Date: 2021-10-08 18:17:16
Message-ID: 039b712e-e02f-4470-b6b4-7f810cc1bcb5@www.fastmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Prefix matching should not omit stop words, as matching lexemes may legitimately begin with stop words.

# select to_tsquery('english', 'over:*') @@ to_tsvector('english', 'overhaul');
NOTICE: text-search query contains only stop words or doesn't contain lexemes, ignored
?column?
----------
f
(1 row)

I noticed this after implementing interactive, incremental search in an application. As the user typed "overhaul," with each successive character executing a search, "ove" and "overh" matched a particular document, but "over" did not.

Reproduced in PostgreSQL 11, 13, and 14.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Pavel Borisov 2021-10-08 20:30:41 Re: Text search prefix matching and stop words
Previous Message Narayanan Iyer 2021-10-08 17:37:19 RE: GROUP BY using tablename.* does not work if tablename has 1 column with NULL values