NeonN
Neon3d ago
7 replies
slow-yellow

pg_search with additional filters

I have tried repeatedly to implement the additional filters as described here: https://neon.com/guides/pg-search#combining-search-with-filters and it simply doesn't work. Adding a filter as shown like l.name = 'JavaScript' completely breaks the scoring mechanism and the results are totally wrong as far as scoring. Simply removing the additional filter and just running it without that always returns an intellible score, but once you add the filter, the score simply becomes meaningless and order by clause makes no sense. According to the paradedb docs, https://docs.paradedb.com/documentation/filtering#text-fields, in order to actually use a filter like this you need to index it using the literal tokenizer, but when I try their suggested fix, like this, USING bm25(id, description, (category::pdb.literal)) in Neon you get an error that pdb is not defined or available. So how do you implement this properly?
ParadeDB
Filter search results based on metadata from other fields
Filtering - ParadeDB
Neon
A guide to building a full-text search experience with pg_search on Neon
Building an End-to-End Full-Text Search Experience With pg_search o...
Was this page helpful?