Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-96165

Generalize $sort after $search optimization beyond metadata

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Integration

      In SERVER-96059 an optimization was introduced to remove a redundant $sort stage after a $search stage, if the sort criteria matched and was on metadata.

       

      This ticket would be to investigate what sort criteria this could be generalized to, and implement the generalization.

       

      Previously, we started with only metadata, as this is all that applied to hybrid search, and there is some question around if the $search stage can sort all possible types (not just numbers like 'searchScore').

       

      Note: The current optimization also only matches on a single sorting field like: {$meta: 'searchScore'}, instead of multiple like: {a: 1, b: 1}. We should also investigate matching the $search and $sort sorting spec on compound / multi-field specs.

            Assignee:
            Unassigned Unassigned
            Reporter:
            joseph.shalabi@mongodb.com Joe Shalabi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: