Re: Text search lexer's handling of hyphens and negatives - Mailing list pgsql-general

From raylu
Subject Re: Text search lexer's handling of hyphens and negatives
Date
Msg-id CAPD=2WHyvzOguNw0kU5f=Ri8ek=Lru65nsshGWCyivmifk_pLA@mail.gmail.com
Whole thread Raw
In response to Re: Text search lexer's handling of hyphens and negatives  (Alan Hodgson <ahodgson@lists.simkin.ca>)
Responses Re: Text search lexer's handling of hyphens and negatives
List pgsql-general
On Tue, Oct 15, 2019 at 3:35 PM Alan Hodgson <ahodgson@lists.simkin.ca> wrote:
> My company has found the pg_trm extension to be more useful for partial text searches than the full text functions. I
don'tknow specifically how it might help with your hyphens but it would be worth testing. The docs actually suggest
usingthem in conjunction in some cases. 

We actually do use pg_trgm already for the names/titles of things.
Indexing the content with a trigram index and then doing
LOWER(content) LIKE '%789-xyz%' would certainly work, but
1. we'd have to do a little bit of finagling if we wanted to match on
word boundaries (don't match '6789-xyza' in the above example)
2. trigram indexes are pretty huge for long documents, which is why we
currently only use them for names/titles

We may give up and just use pg_trgm for contents if nothing else works
out but it feels like the text search lexer is _so_ close to what we
want.



pgsql-general by date:

Previous
From: Alan Hodgson
Date:
Subject: Re: Text search lexer's handling of hyphens and negatives
Next
From: Luca Ferrari
Date:
Subject: Re: Securing records using linux grou permissions