How to use atlas search index (field1, field2) with compound index fields (field3, field4)?

I have collection products which has _id, name, description, category, organisation, price. I have created an atlas search index (Index name : atlas_search) for fields name, description. Since I do have other fields category and organisation, I need to query based on these values as well. Here, I want to know that adding these 2 fields ( category and organisation ) along with atlas search index using compound operator [OR] shall I create new compound index ( not atlas search index )? Which approach will be efficient one.

1 Like

When using Atlas Search, create all indexes in its configuration. Non-Atlas Search indexes are not used in $search. I recommend testing in your scenario to be sure you’re getting the correct and most performant option, as some things will depend on what you’re doing in your pipeline besides $search. If you’re only doing $search followed by $limit and/or $project, your best option is going to be purely an Atlas Search index.