-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
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`)