summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/index_tag.cpp
diff options
context:
space:
mode:
authorHari Khalsa <hkhalsa@10gen.com>2013-10-01 22:43:48 -0400
committerHari Khalsa <hkhalsa@10gen.com>2013-10-04 23:27:44 -0400
commitab167c642f49206b4328882286cd5b83c19088bd (patch)
tree1f7c57c90a81cb53b8d37e96fe37ed1621036853 /src/mongo/db/query/index_tag.cpp
parentd09e608691aae000f3176b27cc67a7900229cd1e (diff)
downloadmongo-ab167c642f49206b4328882286cd5b83c19088bd.tar.gz
SERVER-10471 add s2near stage, enable all 2dsphere queries, enable 2d queries (just slow).
Diffstat (limited to 'src/mongo/db/query/index_tag.cpp')
-rw-r--r--src/mongo/db/query/index_tag.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mongo/db/query/index_tag.cpp b/src/mongo/db/query/index_tag.cpp
index f51bf8d9015..5b7d89ebdfb 100644
--- a/src/mongo/db/query/index_tag.cpp
+++ b/src/mongo/db/query/index_tag.cpp
@@ -23,6 +23,8 @@
namespace mongo {
+ // TODO: Move out of the enumerator and into the planner.
+
const size_t IndexTag::kNoIndex = std::numeric_limits<size_t>::max();
void tagForSort(MatchExpression* tree) {
@@ -57,6 +59,14 @@ namespace mongo {
return lhsValue < rhsValue;
}
+ // Next, order so that if there's a GEO_NEAR it's first.
+ if (MatchExpression::GEO_NEAR == lhs->matchType()) {
+ return true;
+ }
+ else if (MatchExpression::GEO_NEAR == rhs->matchType()) {
+ return false;
+ }
+
// Next, order so that the first field of a compound index appears first.
if (lhsPos != rhsPos) {
return lhsPos < rhsPos;