I am having some trouble with the autocomplete atlas search data type when trying to define an index for an array of subdocuments in my document.
My data structure for the documents in my collection looks like this:
{
"data": {
"equipment": {
"entries": [
{
"name": "abcdefg"
}
{
"name": "hijklmno"
}
]
}
}
}
When I define a string index for searching the entries
array, it works as intended and I get logical results. Here is my index definition using the lucene.keyword analyzer:
{
"mappings": {
"dynamic": false,
"fields": {
"data": {
"fields": {
"equipment": {
"fields": {
"entries": {
"fields": {
"name": {
"analyzer": "lucene.keyword",
"searchAnalyzer": "lucene.keyword",
"type": "string"
}
},
"type": "document"
}
},
"type": "document"
}
},
"type": "document"
}
}
}
}
However, when I try the same thing with the autocomplete type, I get an empty result, but no error. Here is how I defined the autocomplete:
{
"mappings": {
"dynamic": false,
"fields": {
"data": {
"fields": {
"equipment": {
"fields": {
"entries": {
"fields": {
"name": {
"tokenization": "nGram",
"type": "autocomplete"
}
},
"type": "document"
}
},
"type": "document"
}
},
"type": "document"
}
}
}
}
The documentation for Atlas Search states the following: The autocomplete type can't be used to index fields whose value is an array of strings. So either this sentence has to be changed to say all kinds of arrays or I am doing something wrong here. Can someone clarify if this is even possible? Thanks in Advance