cdp-frontend icon indicating copy to clipboard operation
cdp-frontend copied to clipboard

Implement strict search and other useful search operators

Open evamaxfield opened this issue 3 years ago • 0 comments

I would love this for the general event search too so I am going to work on that problem right now.

Originally posted by @JacksonMaxfield in https://github.com/CouncilDataProject/cdp-frontend/issues/137#issuecomment-986056104

I would love this for the general event search too so I am going to work on that problem right now.

Pausing for a bit on this because I think alg is somewhat hard.... in psuedocode it's something like:

query = 'hello world testing "strict part a" "strict part b'
// some func to get to query parts
queryParts = ["hello", "world", "testing", '"strict part a"', '"strict part b"']
// some func to move to ngrams for non strict parts
ngramSearches = ["hello", "hello world", "hello world testing", "world", "world testing", "testing"]
// some func to move to just strict parts
strictSearches = ["strict part a", "strict part b"]
// some func to clean and stem both
cleanedNGramSearches = ["hello", "hello world", "hello world test", "world", "world test", "test"]
cleanedStrictSearches = ["strict part a", "strict part b"]
// run queries for the strict searches first
// run queries for the grams like how we are currently doing it but filtered by events that matched the strict results first??? (which means really all these results are doing are adding weighting to events which is fine)
// merge to unified event gram results

But that leaves interesting questions like how do we handle AND and OR. Need to look to google for how they are doing it basically imo.

evamaxfield avatar Dec 04 '21 18:12 evamaxfield