[DOCS-6017] Comment on: "manual/reference/operator/aggregation/geoNear.txt" Created: 11/Aug/15  Updated: 30/Oct/23  Resolved: 01/Nov/22

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Bug Priority: Major - P3
Reporter: Andre Spiegel Assignee: Kay Kim (Inactive)
Resolution: Won't Fix Votes: 0
Labels: bite-sized
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Location: http://docs.mongodb.org/manual/reference/operator/aggregation/geoNear/
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.155 Safari/537.36
Referrer: https://www.google.com/
Screen Resolution: 1440 x 900
repo: docs
source: reference/operator/aggregation/geoNear


Issue Links:
Related
is related to DOCS-6733 Comment on: "manual/reference/operato... Closed
Participants:
Days since reply: 1 year, 14 weeks, 1 day ago
Epic Link: DOCSP-1769
Story Points: 0.25

 Description   

This page should document how the optional "query" predicate and the geo search work together, and how it relates to indexes. From my experiments, this is how I think it works:

a) If there is only an index on the geo field, the query predicate is an additional filter stage that may or may not be present and which is not particularly optimized.
b) If there is a compound index on the geo field and the field(s) used by the query, then that index will be used for the $geoNear, and it will speed up the whole thing considerably. The speedup can be different depending on whether the query attributes come before the geo field or after it in the index.
c) If the geo field is only one of several fields in a compound index, and it is not the first field in that index, then there must be a query parameter in the $geoNear and it must contain a predicate on the fields that come before the geo field in the compound index, otherwise you'll get an error message saying the query engine cannot be started.

This should be documented.



 Comments   
Comment by Education Bot [ 01/Nov/22 ]

Hello! This ticket has been closed due to inactivity. If you believe this ticket is still important, please reopen it and leave a comment to explain why. Thank you!

Generated at Thu Feb 08 07:51:28 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.