Atlas is currently in use.
It is mongodb ver 8.0.
Regarding the atlas search string facet, I understand that the search index is now indexed as token instead of string facet, but there is something wrong with the query result.
please look follow example.
documents
{
"extraction": {
"keywords": ["a", "b", "c"]
}
},
{
"extraction": {
"keywords": ["b", "c", "d", "e"]
}
},
search index
wrong case
{
"mappings": {
"dynamic": false,
"fields": {
"extraction": {
"fields": {
"keywords": [
{
"type": "token"
}
]
},
"type": "document"
}
}
}
}
In the above case, the aggregate results are weird.
right case
"mappings": {
"dynamic": false,
"fields": {
"extraction": {
"fields": {
"keywords": [
{
"type": "token"
},
{
"type": "stringFacet"
}
]
},
"type": "document"
}
}
}
}
set this case to ensure that the aggregate results are normal.
In conclusion, string facet must be used to properly operate the facet for the string array field below the document.