Hey I have a problem with my aggregation search. following statement gives me the proper result. just additionally i need to specify not deleted elements. I need to specify that produces and companies are different collections.
[
{
'$search': {
'index': 'company_index',
'compound': {
'should': [
{
'autocomplete': {
'path': 'companyName',
'query': 'apple'
}
}, {
'embeddedDocument': {
'path': 'produces',
'operator': {
'compound': {
'must': [
{
'autocomplete': {
'path': 'produces.name',
'query': 'apple',
'fuzzy': {
'maxEdits': 2,
'prefixLength': 3
}
}
}
]
}
}
}
}
]
}
}
}, {
'$match': {
'status': 'VERIFIED'
}
}, {
'$skip': 0
}, {
'$limit': 24
}, {
'$project': {
'companyName': 1,
'status': 1,
'score': {
'$meta': 'searchScore'
}
}
}
]
So when i add this statement into must it gives me no result, what am i doing wrong at this point ?
{
'equals': {
'path': 'produces.deleted',
'value': false,
}