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.

Thanks

what is your query like?

db.table.count({"$and":[{"category_id":{"$in":[1,2,3,4,5,7,8,9,10,11,12,14,16,17,18,19,18775,23,24,25,26]}},{"report_status":"passed"},{"$and":[{"is_branded":0},{"avg":{"$gt":0}}]}]})

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.