how to search in multiple collection using $search autocomplete ex- User and Address collection both
{
'$search': {
'index': 'User',
'compound':{
should: [
{
autocomplete: {
query: 'marty',
path: 'username'
}
},
{
autocomplete: {
query: 'marty',
path: 'fname'
}
},
{
autocomplete: {
query: 'marty',
path: 'lname'
}
}
]
}
}
}