Skip to Main Content

MongoByte MongoDB Logo

Welcome to the new MongoDB Feedback Portal!

{Improvement: "Your idea"}
We’ve upgraded our system to better capture and act on your feedback.
Your feedback is meaningful and helps us build better products.

Status Will Not Implement
Categories Atlas Search
Created by Guest
Created on Aug 31, 2021

Allow $match or $sort stages that follow the $search stage to use MongoDB native indexes

Currently, if there are `$match` or `$sort` stages that follow the `$search` stage, then those `$match` and `$sort` stages are unable to use MongoDB's native indexes on the fields being matched/sorted. While the [documentation recommends](https://docs.atlas.mongodb.com/reference/atlas-search/performance/#-match-aggregation-stage-usage) 1) designing your `$search` query so that all necessary filtering occurs in the `$search` stage which removes the need for a `$match` stage **and** 2) instead of using a `$sort` stage, using the `$near` operator to sort documents based on a `numeric`, `date`, or `geo` field, **_such changes are not always feasible_** depending on the use-case. In such instances, having a `$match` and `$sort` after the `$search` can be unavoidable; and in those instances, it would be ideal for those `$match` and `$sort` stages to be able to use MongoDB native indexes on the fields being matched/sorted. This is a feature request to introduce the functionality which will allow `$match` or `$sort` stages that follow the `$search` stage to use MongoDB native indexes on the fields being matched/sorted. That way, the `$search` stage can utilize the Atlas Search index, while the `$match`/`$sort` stages that follow it can use the MongoDB native indexes, making the query more performant.
  • ADMIN RESPONSE
    Oct 18, 2025
    The spirit of this request is to provide faster sorted results with Atlas Search. Efficient sorting of results when using Atlas Search is an important use-case to us and that we are proactively exploring what features we can provide in this regard. After reviewing with the engineering team, we've determined that this particular approach will not provide the intended benefits so we will not be pursuing it.  Please follow Faster Sorting with Atlas Search ( https://feedback.mongodb.com/forums/924868-atlas-search/suggestions/45316366-faster-sorting-with-atlas-search ) for future developments.