falcony-io / sqlalchemy-searchable

Fulltext searchable models for SQLAlchemy. Only supports PostgreSQL
Other
263 stars 44 forks source link

support for ts_headline #92

Open ghost opened 4 years ago

ghost commented 4 years ago

It would be awesome to have ts_headline support in sqlalchemy-searchable, see https://www.postgresql.org/docs/current/textsearch-controls.html#TEXTSEARCH-HEADLINE

jfilter commented 4 years ago

I created the query for ts_headline manually:

https://github.com/dmedak/verfassungsschutzberichte.de/blob/ed9cb0baf051159b93a6c7d53f17644051e0dac8/src/app.py#L440

sebastianelsner commented 3 years ago

Thanks, I got this to work, but in the end had to go away from Postgres FTS since it can't do suffix searches for german compound words a la "*:wald" without significant work to be put into custom dictionaries and even then its not "feature complete" since the dictionary might miss words.

jfilter commented 3 years ago

If you want to do suffix search: insert the text reversed and then do a prefix search.

sebastianelsner commented 3 years ago

Yes, but as far as I understand this does not work with "Donaudampfschiffahrtsgesellschaftskapitän" :D

jfilter commented 3 years ago

I see. ;)