This is my Index Definition in Monodb Atlas Search.
{"mappings": {"dynamic": false,"fields": {"title": {"type": "string" } } }}
This is my query.
const searchPipeline = ({query}) => { return [ { $search: { index: "default", text: { query, path: ["title"], fuzzy: { maxEdits: 2, prefixLength: 1, }, }, }, }, ];};
Problem is that when query is "audi a2" it matches everything that has "audi" in title. I want it to behave following way:
- query="audi" -> match everything with "audi" in title
- query="audi a2" -> match everything with "audi a2" in title but not "audi a1", "audi a3" etc...
I'm not into BE much but I am learning new stuff at the moment. ChatGPT wasn't helpful at all.