How to search in multiple collection using $search and autocomplete in more then one collection

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'
                }
            }
            ]
        }
	}
}

Hi @ABHINANDAN_MAITY , you can use $lookup to join two collections to search across. See the tutorials on searching across collections here.

It’s really depends on the output you need, it’s either using $lookup as suggested or $unionwith
The different between those two is $lookup append another document to exist document
while $unionwith append collection to another collection