From f8c5f009ac1def37d73b20d45dd9352e36849cb9 Mon Sep 17 00:00:00 2001 From: Bernard Gorman Date: Thu, 6 Sep 2018 16:30:44 +0100 Subject: SERVER-36362 Do not consider an 'allPaths' index for a $text query --- src/mongo/db/query/planner_ixselect.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/mongo/db/query/planner_ixselect.h') diff --git a/src/mongo/db/query/planner_ixselect.h b/src/mongo/db/query/planner_ixselect.h index b1834a1610e..b0181fab150 100644 --- a/src/mongo/db/query/planner_ixselect.h +++ b/src/mongo/db/query/planner_ixselect.h @@ -227,6 +227,17 @@ private: static void stripInvalidAssignmentsTo2dsphereIndices(MatchExpression* node, const std::vector& indices); + /** + * This function strips RelevantTag assignments to expanded 'allPaths' indexes, in cases where + * the assignment is incompatible with the query. + * + * Specifically, if the query has a TEXT node with both 'text' and 'allPaths' indexes present, + * then the 'allPaths' index will mark itself as relevant to the '_fts' path reported by the + * TEXT node. We therefore remove any such misassigned 'allPaths' tags here. + */ + static void stripInvalidAssignmentsToAllPathsIndexes(MatchExpression* root, + const std::vector& indices); + /** * This function strips RelevantTag assignments to partial indices, where the assignment is * incompatible with the index's filter expression. -- cgit v1.2.1