summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/query_solution.cpp
diff options
context:
space:
mode:
authorJason Rassi <rassi@10gen.com>2015-11-18 17:31:32 -0500
committerJason Rassi <rassi@10gen.com>2015-11-18 17:38:27 -0500
commit23136883e394b73cbc26f873cd0276779adef3df (patch)
treeb53259aeeaeb8a7e7450796dec662157d9b0a44d /src/mongo/db/query/query_solution.cpp
parent7bac6c8f64019082f205c7606c65f173972960a3 (diff)
downloadmongo-23136883e394b73cbc26f873cd0276779adef3df.tar.gz
SERVER-19510 Move text query parsing to TextMatchExpression::init()
- Introduces FTSQuery, which is now the base class for FTSQueryImpl. - Introduces a derived class FTSQueryNoop (which TextNoOpMatchExpression now wraps). libfts_query_noop is now linked into db/matcher/expressions. - TextMatchExpression now parses the text query (which acquires a collection lock as part of the parsing process), and TextNode now stores a parsed version of the query. The FTSQuery::parse() call in buildStages() is removed. Behavior change: $text against a non-existent collection now returns an error, instead of an empty result set.
Diffstat (limited to 'src/mongo/db/query/query_solution.cpp')
-rw-r--r--src/mongo/db/query/query_solution.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/mongo/db/query/query_solution.cpp b/src/mongo/db/query/query_solution.cpp
index 345a4132b0c..a80f9199b33 100644
--- a/src/mongo/db/query/query_solution.cpp
+++ b/src/mongo/db/query/query_solution.cpp
@@ -73,13 +73,13 @@ void TextNode::appendToString(mongoutils::str::stream* ss, int indent) const {
addIndent(ss, indent + 1);
*ss << "keyPattern = " << indexKeyPattern.toString() << '\n';
addIndent(ss, indent + 1);
- *ss << "query = " << query << '\n';
+ *ss << "query = " << ftsQuery->getQuery() << '\n';
addIndent(ss, indent + 1);
- *ss << "language = " << language << '\n';
+ *ss << "language = " << ftsQuery->getLanguage() << '\n';
addIndent(ss, indent + 1);
- *ss << "caseSensitive= " << caseSensitive << '\n';
+ *ss << "caseSensitive= " << ftsQuery->getCaseSensitive() << '\n';
addIndent(ss, indent + 1);
- *ss << "diacriticSensitive= " << diacriticSensitive << '\n';
+ *ss << "diacriticSensitive= " << ftsQuery->getDiacriticSensitive() << '\n';
addIndent(ss, indent + 1);
*ss << "indexPrefix = " << indexPrefix.toString() << '\n';
if (NULL != filter) {
@@ -95,10 +95,7 @@ QuerySolutionNode* TextNode::clone() const {
copy->_sort = this->_sort;
copy->indexKeyPattern = this->indexKeyPattern;
- copy->query = this->query;
- copy->language = this->language;
- copy->caseSensitive = this->caseSensitive;
- copy->diacriticSensitive = this->diacriticSensitive;
+ copy->ftsQuery = this->ftsQuery->clone();
copy->indexPrefix = this->indexPrefix;
return copy;