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

Populate CursorOptions.batchSize for $searchMeta

    • Query Integration

      Background

      Currently, the server populates `batchSize` in CursorOptions for SearchCommand and GetMore for queries initiated by `$search`. If it is not populated, Mongot will compute scores and read _id for 101 top documents.

       

      Problem:

      `searchMeta` is used for pure facets results or count, and Mongot doesn't need to do scoring or _id lookup. However, Mongot currently has no indication it's serving a $searchMeta request, so it still retrieves and scores 101 results.

       

      Solution

      Mongod should indicate to Mongot via CursorOptions that it doesn't need a document cursor. This can be approximated today without new syntax by setting `batchSize:1` for all `searchMeta` requests. (As of writing, Mongot does not support batchSize:0`)

            Assignee:
            Unassigned Unassigned
            Reporter:
            evan.darke@mongodb.com Evan Darke
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: