Re:Postgres Full-Text Search: A search engine in a database
by mjewkes on Tuesday July 27, 2021 @08:25PM
(#27979153)
Try
https://simonwillison.net/search/?q=%22your+own+benchmarks%2...
Looks like we get 37 results, of which 2 are true positives.
Looks like "your" and "own" are both contained in the english.stop stopwords list. So you could fix this by removing stopwords from your dictionary.
While disabling the stemmer is relatively easy (use the 'simple' language setting for your ts_query), altering the stopword dictionaries is more involved, and not easy to maintain or pass between developers/environments, and not at all easy to share between queries.
And so the most common suggestion is to use ILIKE.
Lucene has no problems with any of this.
Re:Postgres Full-Text Search: A search engine in a database
by SahAssar on Tuesday July 27, 2021 @06:27PM
(#27978424)
I had some issues with this recently as I couldn't get a FTS query to find something looking like a path or url in a query. As an example from your site: https://simonwillison.net/2020/Jan/6/sitemap-xml/ contains the exact text https://www.niche-museums.com/, but I cannot find a way to search for that phrase exactly (trying https://simonwillison.net/search/?q=%22www.niche-museums.com... works though). I tried both in my own psql setup and on your site, and it seems like exact phrase searching is limited to the language used, even if it would be an exact string match.
Are there any workarounds for that?
I'm using search_type=websearch https://github.com/simonw/simonwillisonblog/blob/a5b53a24b00...
That's using websearch_to_tsquery() which was added in PostgreSQL 11: https://www.postgresql.org/docs/11/textsearch-controls.html#...