...

или внеочередные заметки



  • 1

combining tsearch's prefix-search

Hi Oleg!
I'm very excited about your work, nice!

I posted this on pgsql-general, don't know if you follow that list, so I'll ask here.

Is it possible to combine tsearch's prefix-search with the new JSONB-format?

Something like this (pseudo-code):
SELECT '{"subject": "visena"}'::jsonb @> '{"subject": to_tsquery('simple', '(vise:*|office:*)')}';

and have the above query match documents where subject contains the prefixes "vise" and "office", which would match subject="visena" and subject="officenet".
expanding this to be able to search for things like:

subject=to_tsquery('simple', '(vise:*|office:*)') OR recipient=to_tsquery('simple', '(somefirstname:*|somelastname:*)') OR content=to_tsquery('simple', '(string1:*&string2:*)')

Would be ultimate cool if this was possible!

Thanks.

--
Andreas

  • 1
?

Log in