Hi, I’m also having issues using Atlas Search for fields that are array of strings…
I have a very simple index and it won’t do even basic search that a regex would.
For example, I have in my collection around 32.000 documents on this format:
{
"_id": "59d400b6d8c987b0196efe50",
"name": "Natura",
"domains": [
"natura.net",
"natura.com"
]
}
I made a very simple Atlas Search index like this:
{
"mappings": {
"dynamic": false,
"fields": {
"domains": {
"type": "string"
}
}
}
}
And even with a very basic search like this, it won’t return correct results:
Search:
{
$search: {
index: 'companyDomains',
text: {
query: "natura",
path: "domains",
fuzzy: {},
},
},
}
Result:
[
{
"_id": "5f6210981923bf120bdac7b7",
"name": "Laura",
"domains": [
"laura-br.com"
]
}
]
Which is very weird, because the only result returned has almost nothing to do with the search string.
If I make a simple regex $match stage with domains: /natura/i
, I get 14 results!
I’m still trying to understand what’s the issue with Atlas Search and array of strings…