Hi,
While using Atlas Search feature on M2 cluster I’ve got error Remote error from mongot :: caused by :: Index 12 out of bounds for length 12
This is not working query:
db.getCollection('my-documents').aggregate([
{
"$search": {
"compound": {
"filter": [
{
"equals": {
"value": ObjectId('5ea6fa18ef17e8002708feea'),
"path": "tenantId"
}
}
],
"must": [
{
"text": {
"query": "Abcd",
"path": [
"field1",
"field2",
"field3"
],
"fuzzy": {
"prefixLength": 2
}
}
}
]
},
"highlight": {
"path": [
"field1",
"field2",
"field3"
]
}
}
},
{
"$limit": 15
},
{
"$project": {
"_id": 1,
"field1": 1,
"field2": 1,
"field3": 1,
"score": {
"$meta": "searchScore"
},
"highlight": {
"$meta": "searchHighlights"
}
}
}
])
After few experiments I realised that it will work when I remove “filter” operator or “highlight” option from $search but then I will lose key logic.
What is interesting on M0 tire clusters I don’t have this problem. I’m not sure if it is cluster tire related error or data related error.
Thanks for any help.