Need help for which index is best when always using $in query in field

I have large number off data in single collection approx 25M. Now always we are doing search on category user have to select at least 1 category and perform the search action. We have 30 category of data in collection now user select 20+ category sometime at that time query not getting fast result and taking more than 40 or 45 sec. so which index I need to use for that category column. in category column we have inserted category id.


what is your query like?


user have to select category compulsory so multiple catergory_id is always in $and condition.

Check ESR rule.

Explain output is also a good start.