I’ve been playing around with atlas search and wrote a routine that tests a number of different methodologies for it’s use case. This has spawned a few questions that I either cannot find answers for or which have some documentation that I may not understand fully
- I do not really want a regex, but I do want a partial match. For example: “456” should find “4567”. This seems to work with Autocomplete only(or creative regex). However Autocomplete does not support wildcard match or multiple path match. Is it possible to do a partial match on 2-3 fields? Which are the only fields my users would ever search on?
- I think I need to use compound for this one, but I am struggling with syntax, which may just be my fault due to how I wrote the code. Regardless, I am using FilterDefintions" or LINQ style statements in many spots, example: x=> x.CompanyID == “XXXX” or builder.Eq(“ID”, new ObjectId(“XXX”)). I want to combine this with atlas search but it seems atlas search wants things in a completely different format. I guess this is ok, but obviously changes my entire code so I am being a baby about it
It also makes my much more complex FilterDefinitions challenging to “rewrite” for the Atlas Text Search
What I am ultimately trying to solve with #2 is avoiding the multi-stage pipeline of .Search + .Match, and of course Match cannot go first in the pipeline.
My use case is that I 100% know I need to filter based on moderately complex set of natural filters. Let’s say something like “belongs to this group, is not flagged for quarantine, i have access to it, etc” and then I want to take that subset and search based on user input which is where the power of the Atlas Search comes in. However I want to artificially limit the possible subset they are searching on based on a dynamic set of other field restrictions.
FYI .Search + .Match works perfectly but it is slow, as your documentation indicates it would be. What sort of options do I have here other than finding a way to completely redo all my FilterDefinitions as a collection of .Must(something’s)? I also noticed not all of my filters would be supported via that style, though I think it would cover most.
I hope these questions make sense and I would be happy to provide examples upon request, but it is somewhat theoretical at the moment.