diff options
author | Jason Rassi <rassi@10gen.com> | 2015-11-18 17:25:21 -0500 |
---|---|---|
committer | Jason Rassi <rassi@10gen.com> | 2015-11-18 17:36:11 -0500 |
commit | 7bac6c8f64019082f205c7606c65f173972960a3 (patch) | |
tree | adb98230f227ebb22fbde6a1f5d94a7e634ba78c | |
parent | e261ce9d033acc2e7f87c94dca882c8e897f9b10 (diff) | |
download | mongo-7bac6c8f64019082f205c7606c65f173972960a3.tar.gz |
SERVER-19510 Rename FTSQuery to FTSQueryImpl
Groundwork for upcoming change to introduce a "no-op" text query.
-rw-r--r-- | src/mongo/db/exec/plan_stats.h | 2 | ||||
-rw-r--r-- | src/mongo/db/exec/text.h | 6 | ||||
-rw-r--r-- | src/mongo/db/exec/text_match.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/exec/text_match.h | 6 | ||||
-rw-r--r-- | src/mongo/db/fts/SConscript | 4 | ||||
-rw-r--r-- | src/mongo/db/fts/fts_basic_tokenizer.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/fts/fts_matcher.cpp | 3 | ||||
-rw-r--r-- | src/mongo/db/fts/fts_matcher.h | 6 | ||||
-rw-r--r-- | src/mongo/db/fts/fts_matcher_test.cpp | 22 | ||||
-rw-r--r-- | src/mongo/db/fts/fts_query_impl.cpp (renamed from src/mongo/db/fts/fts_query.cpp) | 24 | ||||
-rw-r--r-- | src/mongo/db/fts/fts_query_impl.h (renamed from src/mongo/db/fts/fts_query.h) | 6 | ||||
-rw-r--r-- | src/mongo/db/fts/fts_query_impl_test.cpp (renamed from src/mongo/db/fts/fts_query_test.cpp) | 72 | ||||
-rw-r--r-- | src/mongo/db/fts/fts_unicode_tokenizer.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/matcher/expression_text.cpp | 4 | ||||
-rw-r--r-- | src/mongo/db/query/query_solution.h | 4 |
15 files changed, 83 insertions, 82 deletions
diff --git a/src/mongo/db/exec/plan_stats.h b/src/mongo/db/exec/plan_stats.h index 14e07391920..211b975b9dc 100644 --- a/src/mongo/db/exec/plan_stats.h +++ b/src/mongo/db/exec/plan_stats.h @@ -601,7 +601,7 @@ struct TextStats : public SpecificStats { std::string indexName; - // Human-readable form of the FTSQuery associated with the text stage. + // Human-readable form of the FTSQueryImpl associated with the text stage. BSONObj parsedTextQuery; // Index keys that precede the "text" index key. diff --git a/src/mongo/db/exec/text.h b/src/mongo/db/exec/text.h index e0636422eff..a79634c0fb7 100644 --- a/src/mongo/db/exec/text.h +++ b/src/mongo/db/exec/text.h @@ -33,7 +33,7 @@ #include "mongo/db/exec/plan_stage.h" #include "mongo/db/exec/working_set.h" -#include "mongo/db/fts/fts_query.h" +#include "mongo/db/fts/fts_query_impl.h" #include "mongo/db/fts/fts_spec.h" #include "mongo/db/fts/fts_util.h" #include "mongo/db/index/index_descriptor.h" @@ -43,7 +43,7 @@ namespace mongo { using std::unique_ptr; using std::vector; -using fts::FTSQuery; +using fts::FTSQueryImpl; using fts::FTSSpec; class OperationContext; @@ -61,7 +61,7 @@ struct TextStageParams { BSONObj indexPrefix; // The text query. - FTSQuery query; + FTSQueryImpl query; }; /** diff --git a/src/mongo/db/exec/text_match.cpp b/src/mongo/db/exec/text_match.cpp index 0dc2bf8b5a6..37d199011bd 100644 --- a/src/mongo/db/exec/text_match.cpp +++ b/src/mongo/db/exec/text_match.cpp @@ -47,7 +47,7 @@ const char* TextMatchStage::kStageType = "TEXT_MATCH"; TextMatchStage::TextMatchStage(OperationContext* opCtx, unique_ptr<PlanStage> child, - const FTSQuery& query, + const FTSQueryImpl& query, const FTSSpec& spec, WorkingSet* ws) : PlanStage(kStageType, opCtx), _ftsMatcher(query, spec), _ws(ws) { diff --git a/src/mongo/db/exec/text_match.h b/src/mongo/db/exec/text_match.h index 7b707efda5b..be1e6a2dd79 100644 --- a/src/mongo/db/exec/text_match.h +++ b/src/mongo/db/exec/text_match.h @@ -33,7 +33,7 @@ #include "mongo/db/exec/plan_stage.h" #include "mongo/db/exec/working_set.h" #include "mongo/db/fts/fts_matcher.h" -#include "mongo/db/fts/fts_query.h" +#include "mongo/db/fts/fts_query_impl.h" #include "mongo/db/fts/fts_spec.h" namespace mongo { @@ -41,7 +41,7 @@ namespace mongo { using std::unique_ptr; using fts::FTSMatcher; -using fts::FTSQuery; +using fts::FTSQueryImpl; using fts::FTSSpec; @@ -59,7 +59,7 @@ class TextMatchStage final : public PlanStage { public: TextMatchStage(OperationContext* opCtx, unique_ptr<PlanStage> child, - const FTSQuery& query, + const FTSQueryImpl& query, const FTSSpec& spec, WorkingSet* ws); ~TextMatchStage(); diff --git a/src/mongo/db/fts/SConscript b/src/mongo/db/fts/SConscript index 833cf17d8d6..300f05c04e0 100644 --- a/src/mongo/db/fts/SConscript +++ b/src/mongo/db/fts/SConscript @@ -35,7 +35,7 @@ baseEnv.InjectThirdPartyIncludePaths(libraries=['stemmer']) baseEnv.Library('base', [ 'fts_index_format.cpp', 'fts_matcher.cpp', - 'fts_query.cpp', + 'fts_query_impl.cpp', 'fts_query_parser.cpp', 'fts_spec.cpp', 'fts_spec_legacy.cpp', @@ -93,7 +93,7 @@ env.CppUnitTest( "fts_language_test", "fts_language_test.cpp", env.CppUnitTest( "fts_matcher_test", "fts_matcher_test.cpp", LIBDEPS=["base"] ) -env.CppUnitTest( "fts_query_test", "fts_query_test.cpp", +env.CppUnitTest( "fts_query_impl_test", "fts_query_impl_test.cpp", LIBDEPS=["base"] ) env.CppUnitTest( "fts_spec_test", "fts_spec_test.cpp", diff --git a/src/mongo/db/fts/fts_basic_tokenizer.cpp b/src/mongo/db/fts/fts_basic_tokenizer.cpp index a053d21140a..d8cb9874772 100644 --- a/src/mongo/db/fts/fts_basic_tokenizer.cpp +++ b/src/mongo/db/fts/fts_basic_tokenizer.cpp @@ -30,7 +30,7 @@ #include "mongo/db/fts/fts_basic_tokenizer.h" -#include "mongo/db/fts/fts_query.h" +#include "mongo/db/fts/fts_query_impl.h" #include "mongo/db/fts/fts_spec.h" #include "mongo/db/fts/stemmer.h" #include "mongo/db/fts/stop_words.h" diff --git a/src/mongo/db/fts/fts_matcher.cpp b/src/mongo/db/fts/fts_matcher.cpp index 7689f15acf3..6a782e730cc 100644 --- a/src/mongo/db/fts/fts_matcher.cpp +++ b/src/mongo/db/fts/fts_matcher.cpp @@ -41,7 +41,8 @@ namespace fts { using std::string; -FTSMatcher::FTSMatcher(const FTSQuery& query, const FTSSpec& spec) : _query(query), _spec(spec) {} +FTSMatcher::FTSMatcher(const FTSQueryImpl& query, const FTSSpec& spec) + : _query(query), _spec(spec) {} bool FTSMatcher::matches(const BSONObj& obj) const { if (canSkipPositiveTermCheck()) { diff --git a/src/mongo/db/fts/fts_matcher.h b/src/mongo/db/fts/fts_matcher.h index 45bfa360b09..86ac5faa744 100644 --- a/src/mongo/db/fts/fts_matcher.h +++ b/src/mongo/db/fts/fts_matcher.h @@ -30,7 +30,7 @@ #pragma once -#include "mongo/db/fts/fts_query.h" +#include "mongo/db/fts/fts_query_impl.h" #include "mongo/db/fts/fts_spec.h" #include "mongo/db/fts/fts_tokenizer.h" #include "mongo/db/fts/tokenizer.h" @@ -43,7 +43,7 @@ class FTSMatcher { MONGO_DISALLOW_COPYING(FTSMatcher); public: - FTSMatcher(const FTSQuery& query, const FTSSpec& spec); + FTSMatcher(const FTSQueryImpl& query, const FTSSpec& spec); /** * Returns whether 'obj' matches the query. An object is considered to match the query @@ -109,7 +109,7 @@ private: FTSTokenizer::Options _getTokenizerOptions() const; // TODO These should be unowned pointers instead of owned copies. - const FTSQuery _query; + const FTSQueryImpl _query; const FTSSpec _spec; }; } diff --git a/src/mongo/db/fts/fts_matcher_test.cpp b/src/mongo/db/fts/fts_matcher_test.cpp index 246510a9e70..02f6c2b2ba0 100644 --- a/src/mongo/db/fts/fts_matcher_test.cpp +++ b/src/mongo/db/fts/fts_matcher_test.cpp @@ -37,7 +37,7 @@ namespace mongo { namespace fts { TEST(FTSMatcher, NegWild1) { - FTSQuery q; + FTSQueryImpl q; ASSERT_OK(q.parse("foo -bar", "english", false, false, TEXT_INDEX_VERSION_3)); FTSMatcher m(q, FTSSpec(FTSSpec::fixSpec(BSON("key" << BSON("$**" @@ -51,7 +51,7 @@ TEST(FTSMatcher, NegWild1) { // Regression test for SERVER-11994. TEST(FTSMatcher, NegWild2) { - FTSQuery q; + FTSQueryImpl q; ASSERT_OK(q.parse("pizza -restaurant", "english", false, false, TEXT_INDEX_VERSION_3)); FTSMatcher m(q, FTSSpec(FTSSpec::fixSpec(BSON("key" << BSON("$**" @@ -64,7 +64,7 @@ TEST(FTSMatcher, NegWild2) { } TEST(FTSMatcher, Phrase1) { - FTSQuery q; + FTSQueryImpl q; ASSERT_OK(q.parse("foo \"table top\"", "english", false, false, TEXT_INDEX_VERSION_3)); FTSMatcher m(q, FTSSpec(FTSSpec::fixSpec(BSON("key" << BSON("$**" @@ -86,7 +86,7 @@ TEST(FTSMatcher, Phrase1) { } TEST(FTSMatcher, Phrase2) { - FTSQuery q; + FTSQueryImpl q; ASSERT_OK(q.parse("foo \"table top\"", "english", false, false, TEXT_INDEX_VERSION_3)); FTSMatcher m(q, FTSSpec(FTSSpec::fixSpec(BSON("key" << BSON("x" @@ -97,7 +97,7 @@ TEST(FTSMatcher, Phrase2) { // Test that the matcher parses the document with the document language, not the search // language. TEST(FTSMatcher, ParsesUsingDocLanguage) { - FTSQuery q; + FTSQueryImpl q; ASSERT_OK(q.parse("-glad", "none", false, false, TEXT_INDEX_VERSION_3)); FTSMatcher m(q, FTSSpec(FTSSpec::fixSpec(BSON("key" << BSON("x" @@ -111,7 +111,7 @@ TEST(FTSMatcher, ParsesUsingDocLanguage) { // Test the matcher does not filter out stop words from positive terms TEST(FTSMatcher, MatcherDoesNotFilterStopWordsNeg) { - FTSQuery q; + FTSQueryImpl q; ASSERT_OK(q.parse("-the", "none", false, false, TEXT_INDEX_VERSION_3)); FTSMatcher m(q, FTSSpec(FTSSpec::fixSpec(BSON("key" << BSON("x" @@ -123,7 +123,7 @@ TEST(FTSMatcher, MatcherDoesNotFilterStopWordsNeg) { // Test the matcher does not filter out stop words from negative terms TEST(FTSMatcher, MatcherDoesNotFilterStopWordsPos) { - FTSQuery q; + FTSQueryImpl q; ASSERT_OK(q.parse("the", "none", false, false, TEXT_INDEX_VERSION_3)); FTSMatcher m(q, FTSSpec(FTSSpec::fixSpec(BSON("key" << BSON("x" @@ -136,7 +136,7 @@ TEST(FTSMatcher, MatcherDoesNotFilterStopWordsPos) { // Returns whether a document indexed with text data 'doc' contains any positive terms from // case-sensitive text query 'search'. static bool docHasPositiveTermWithCase(const std::string& doc, const std::string& search) { - FTSQuery q; + FTSQueryImpl q; ASSERT_OK(q.parse(search, "english", true, false, TEXT_INDEX_VERSION_3)); FTSMatcher m(q, FTSSpec(FTSSpec::fixSpec(BSON("key" << BSON("x" @@ -163,7 +163,7 @@ TEST(FTSMatcher, HasPositiveTermCaseSensitive) { // Returns whether a document indexed with text data 'doc' contains any negative terms from // case-sensitive text query 'search'. static bool docHasNegativeTermWithCase(const std::string& doc, const std::string& search) { - FTSQuery q; + FTSQueryImpl q; ASSERT_OK(q.parse(search, "english", true, false, TEXT_INDEX_VERSION_3)); FTSMatcher m(q, FTSSpec(FTSSpec::fixSpec(BSON("key" << BSON("x" @@ -190,7 +190,7 @@ TEST(FTSMatcher, HasNegativeTermCaseSensitive) { // Returns whether a document indexed with text data 'doc' contains all positive phrases // from case-sensitive text query 'search'. static bool docPositivePhrasesMatchWithCase(const std::string& doc, const std::string& search) { - FTSQuery q; + FTSQueryImpl q; ASSERT_OK(q.parse(search, "english", true, false, TEXT_INDEX_VERSION_3)); FTSMatcher m(q, FTSSpec(FTSSpec::fixSpec(BSON("key" << BSON("x" @@ -213,7 +213,7 @@ TEST(FTSMatcher, PositivePhrasesMatchWithCase) { // Returns whether a document indexed with text data 'doc' contains zero negative phrases // from case-sensitive text query 'search'. static bool docNegativePhrasesMatchWithCase(const std::string& doc, const std::string& search) { - FTSQuery q; + FTSQueryImpl q; ASSERT_OK(q.parse(search, "english", true, false, TEXT_INDEX_VERSION_3)); FTSMatcher m(q, FTSSpec(FTSSpec::fixSpec(BSON("key" << BSON("x" diff --git a/src/mongo/db/fts/fts_query.cpp b/src/mongo/db/fts/fts_query_impl.cpp index 3e77701f79f..af03d2ed5da 100644 --- a/src/mongo/db/fts/fts_query.cpp +++ b/src/mongo/db/fts/fts_query_impl.cpp @@ -1,4 +1,4 @@ -// fts_query.cpp +// fts_query_impl.cpp /** * Copyright (C) 2012 10gen Inc. @@ -30,7 +30,7 @@ #include "mongo/platform/basic.h" -#include "mongo/db/fts/fts_query.h" +#include "mongo/db/fts/fts_query_impl.h" #include "mongo/db/fts/fts_spec.h" #include "mongo/db/fts/fts_query_parser.h" @@ -49,11 +49,11 @@ using std::string; using std::stringstream; using std::vector; -Status FTSQuery::parse(const string& query, - StringData language, - bool caseSensitive, - bool diacriticSensitive, - TextIndexVersion textIndexVersion) { +Status FTSQueryImpl::parse(const string& query, + StringData language, + bool caseSensitive, + bool diacriticSensitive, + TextIndexVersion textIndexVersion) { StatusWithFTSLanguage swl = FTSLanguage::make(language, textIndexVersion); if (!swl.getStatus().isOK()) { return swl.getStatus(); @@ -132,7 +132,7 @@ Status FTSQuery::parse(const string& query, return Status::OK(); } -void FTSQuery::_addTerms(FTSTokenizer* tokenizer, const string& sentence, bool negated) { +void FTSQueryImpl::_addTerms(FTSTokenizer* tokenizer, const string& sentence, bool negated) { tokenizer->reset(sentence.c_str(), FTSTokenizer::kFilterStopWords); auto& activeTerms = negated ? _negatedTerms : _positiveTerms; @@ -196,9 +196,9 @@ void _debugHelp(stringstream& ss, const vector<string>& v, const string& sep) { } } -string FTSQuery::toString() const { +string FTSQueryImpl::toString() const { stringstream ss; - ss << "FTSQuery\n"; + ss << "FTSQueryImpl\n"; ss << " terms: "; _debugHelp(ss, getPositiveTerms(), ", "); @@ -219,7 +219,7 @@ string FTSQuery::toString() const { return ss.str(); } -string FTSQuery::debugString() const { +string FTSQueryImpl::debugString() const { stringstream ss; _debugHelp(ss, getPositiveTerms(), "|"); @@ -236,7 +236,7 @@ string FTSQuery::debugString() const { return ss.str(); } -BSONObj FTSQuery::toBSON() const { +BSONObj FTSQueryImpl::toBSON() const { BSONObjBuilder bob; bob.append("terms", getPositiveTerms()); bob.append("negatedTerms", getNegatedTerms()); diff --git a/src/mongo/db/fts/fts_query.h b/src/mongo/db/fts/fts_query_impl.h index ae05100ea37..dbd266983d3 100644 --- a/src/mongo/db/fts/fts_query.h +++ b/src/mongo/db/fts/fts_query_impl.h @@ -1,4 +1,4 @@ -// fts_query.h +// fts_query_impl.h /** * Copyright (C) 2012 10gen Inc. @@ -42,9 +42,9 @@ namespace mongo { namespace fts { -class FTSQuery { +class FTSQueryImpl { public: - // Initializes an FTSQuery. Note that the parsing of "language" depends on the text + // Initializes an FTSQueryImpl. Note that the parsing of "language" depends on the text // index version, since a query which doesn't specify a language and is against a // version 1 text index with a version 1 default language string needs to be parsed as // version 1 (see fts_language.cpp for a list of language strings specific to version diff --git a/src/mongo/db/fts/fts_query_test.cpp b/src/mongo/db/fts/fts_query_impl_test.cpp index bcf9e537142..9f336e3c75b 100644 --- a/src/mongo/db/fts/fts_query_test.cpp +++ b/src/mongo/db/fts/fts_query_impl_test.cpp @@ -1,4 +1,4 @@ -// fts_query_test.cpp +// fts_query_impl_test.cpp /** * Copyright (C) 2012 10gen Inc. @@ -29,14 +29,14 @@ */ -#include "mongo/db/fts/fts_query.h" +#include "mongo/db/fts/fts_query_impl.h" #include "mongo/unittest/unittest.h" namespace mongo { namespace fts { -TEST(FTSQuery, Basic1) { - FTSQuery q; +TEST(FTSQueryImpl, Basic1) { + FTSQueryImpl q; ASSERT(q.parse("this is fun", "english", false, false, TEXT_INDEX_VERSION_3).isOK()); ASSERT_EQUALS(false, q.getCaseSensitive()); @@ -48,8 +48,8 @@ TEST(FTSQuery, Basic1) { ASSERT_TRUE(q.getTermsForBounds() == q.getPositiveTerms()); } -TEST(FTSQuery, ParsePunctuation) { - FTSQuery q; +TEST(FTSQueryImpl, ParsePunctuation) { + FTSQueryImpl q; ASSERT(q.parse("hello.world", "english", false, false, TEXT_INDEX_VERSION_3).isOK()); ASSERT_EQUALS(false, q.getCaseSensitive()); @@ -62,8 +62,8 @@ TEST(FTSQuery, ParsePunctuation) { ASSERT_TRUE(q.getTermsForBounds() == q.getPositiveTerms()); } -TEST(FTSQuery, Neg1) { - FTSQuery q; +TEST(FTSQueryImpl, Neg1) { + FTSQueryImpl q; ASSERT(q.parse("this is -really fun", "english", false, false, TEXT_INDEX_VERSION_3).isOK()); ASSERT_EQUALS(1U, q.getPositiveTerms().size()); @@ -73,8 +73,8 @@ TEST(FTSQuery, Neg1) { ASSERT_TRUE(q.getTermsForBounds() == q.getPositiveTerms()); } -TEST(FTSQuery, Phrase1) { - FTSQuery q; +TEST(FTSQueryImpl, Phrase1) { + FTSQueryImpl q; ASSERT(q.parse("doing a \"phrase test\" for fun", "english", false, false, TEXT_INDEX_VERSION_3) .isOK()); @@ -88,30 +88,30 @@ TEST(FTSQuery, Phrase1) { ASSERT_EQUALS("fun|phrase|test||||phrase test||", q.debugString()); } -TEST(FTSQuery, Phrase2) { - FTSQuery q; +TEST(FTSQueryImpl, Phrase2) { + FTSQueryImpl q; ASSERT(q.parse("doing a \"phrase-test\" for fun", "english", false, false, TEXT_INDEX_VERSION_3) .isOK()); ASSERT_EQUALS(1U, q.getPositivePhr().size()); ASSERT_EQUALS("phrase-test", q.getPositivePhr()[0]); } -TEST(FTSQuery, NegPhrase1) { - FTSQuery q; +TEST(FTSQueryImpl, NegPhrase1) { + FTSQueryImpl q; ASSERT( q.parse("doing a -\"phrase test\" for fun", "english", false, false, TEXT_INDEX_VERSION_3) .isOK()); ASSERT_EQUALS("fun||||||phrase test", q.debugString()); } -TEST(FTSQuery, CaseSensitiveOption) { - FTSQuery q; +TEST(FTSQueryImpl, CaseSensitiveOption) { + FTSQueryImpl q; ASSERT(q.parse("this is fun", "english", true, false, TEXT_INDEX_VERSION_3).isOK()); ASSERT_EQUALS(true, q.getCaseSensitive()); } -TEST(FTSQuery, CaseSensitivePositiveTerms) { - FTSQuery q; +TEST(FTSQueryImpl, CaseSensitivePositiveTerms) { + FTSQueryImpl q; ASSERT(q.parse("This is Positively fun", "english", true, false, TEXT_INDEX_VERSION_3).isOK()); ASSERT_EQUALS(2U, q.getTermsForBounds().size()); @@ -126,8 +126,8 @@ TEST(FTSQuery, CaseSensitivePositiveTerms) { ASSERT_EQUALS(0U, q.getNegatedPhr().size()); } -TEST(FTSQuery, CaseSensitiveNegativeTerms) { - FTSQuery q; +TEST(FTSQueryImpl, CaseSensitiveNegativeTerms) { + FTSQueryImpl q; ASSERT(q.parse("-This -is -Negatively -miserable", "english", true, false, TEXT_INDEX_VERSION_3) .isOK()); @@ -140,8 +140,8 @@ TEST(FTSQuery, CaseSensitiveNegativeTerms) { ASSERT_EQUALS(0U, q.getNegatedPhr().size()); } -TEST(FTSQuery, CaseSensitivePositivePhrases) { - FTSQuery q; +TEST(FTSQueryImpl, CaseSensitivePositivePhrases) { + FTSQueryImpl q; ASSERT(q.parse("doing a \"Phrase Test\" for fun", "english", true, false, TEXT_INDEX_VERSION_3) .isOK()); @@ -150,8 +150,8 @@ TEST(FTSQuery, CaseSensitivePositivePhrases) { ASSERT_EQUALS("Phrase Test", q.getPositivePhr()[0]); } -TEST(FTSQuery, CaseSensitiveNegativePhrases) { - FTSQuery q; +TEST(FTSQueryImpl, CaseSensitiveNegativePhrases) { + FTSQueryImpl q; ASSERT(q.parse("doing a -\"Phrase Test\" for fun", "english", true, false, TEXT_INDEX_VERSION_3) .isOK()); @@ -160,16 +160,16 @@ TEST(FTSQuery, CaseSensitiveNegativePhrases) { ASSERT_EQUALS("Phrase Test", q.getNegatedPhr()[0]); } -TEST(FTSQuery, Mix1) { - FTSQuery q; +TEST(FTSQueryImpl, Mix1) { + FTSQueryImpl q; ASSERT( q.parse("\"industry\" -Melbourne -Physics", "english", false, false, TEXT_INDEX_VERSION_3) .isOK()); ASSERT_EQUALS("industri||melbourn|physic||industry||", q.debugString()); } -TEST(FTSQuery, NegPhrase2) { - FTSQuery q1, q2, q3; +TEST(FTSQueryImpl, NegPhrase2) { + FTSQueryImpl q1, q2, q3; ASSERT(q1.parse("foo \"bar\"", "english", false, false, TEXT_INDEX_VERSION_3).isOK()); ASSERT(q2.parse("foo \"-bar\"", "english", false, false, TEXT_INDEX_VERSION_3).isOK()); ASSERT(q3.parse("foo \" -bar\"", "english", false, false, TEXT_INDEX_VERSION_3).isOK()); @@ -191,8 +191,8 @@ TEST(FTSQuery, NegPhrase2) { ASSERT_EQUALS(0U, q3.getNegatedPhr().size()); } -TEST(FTSQuery, NegPhrase3) { - FTSQuery q1, q2, q3; +TEST(FTSQueryImpl, NegPhrase3) { + FTSQueryImpl q1, q2, q3; ASSERT(q1.parse("foo -\"bar\"", "english", false, false, TEXT_INDEX_VERSION_3).isOK()); ASSERT(q2.parse("foo -\"-bar\"", "english", false, false, TEXT_INDEX_VERSION_3).isOK()); ASSERT(q3.parse("foo -\" -bar\"", "english", false, false, TEXT_INDEX_VERSION_3).isOK()); @@ -216,8 +216,8 @@ TEST(FTSQuery, NegPhrase3) { // Test textIndexVersion:1 query with language "english". This invokes the standard English // stemmer and stopword list. -TEST(FTSQuery, TextIndexVersion1LanguageEnglish) { - FTSQuery q; +TEST(FTSQueryImpl, TextIndexVersion1LanguageEnglish) { + FTSQueryImpl q; ASSERT(q.parse("the running", "english", false, false, TEXT_INDEX_VERSION_1).isOK()); ASSERT_EQUALS(1U, q.getPositiveTerms().size()); ASSERT_EQUALS("run", *q.getPositiveTerms().begin()); @@ -228,8 +228,8 @@ TEST(FTSQuery, TextIndexVersion1LanguageEnglish) { // Test textIndexVersion:1 query with language "eng". "eng" uses the English stemmer, and // no stopword list. -TEST(FTSQuery, TextIndexVersion1LanguageEng) { - FTSQuery q; +TEST(FTSQueryImpl, TextIndexVersion1LanguageEng) { + FTSQueryImpl q; ASSERT(q.parse("the running", "eng", false, false, TEXT_INDEX_VERSION_1).isOK()); ASSERT_EQUALS(2U, q.getPositiveTerms().size()); ASSERT_EQUALS(1, std::count(q.getPositiveTerms().begin(), q.getPositiveTerms().end(), "the")); @@ -241,8 +241,8 @@ TEST(FTSQuery, TextIndexVersion1LanguageEng) { // Test textIndexVersion:1 query with language "invalid". No stemming will be performed, // and no stopword list will be used. -TEST(FTSQuery, TextIndexVersion1LanguageInvalid) { - FTSQuery q; +TEST(FTSQueryImpl, TextIndexVersion1LanguageInvalid) { + FTSQueryImpl q; ASSERT(q.parse("the running", "invalid", false, false, TEXT_INDEX_VERSION_1).isOK()); ASSERT_EQUALS(2U, q.getPositiveTerms().size()); ASSERT_EQUALS(1, std::count(q.getPositiveTerms().begin(), q.getPositiveTerms().end(), "the")); diff --git a/src/mongo/db/fts/fts_unicode_tokenizer.cpp b/src/mongo/db/fts/fts_unicode_tokenizer.cpp index a5460448505..036a7703fc3 100644 --- a/src/mongo/db/fts/fts_unicode_tokenizer.cpp +++ b/src/mongo/db/fts/fts_unicode_tokenizer.cpp @@ -30,7 +30,7 @@ #include "mongo/db/fts/fts_unicode_tokenizer.h" -#include "mongo/db/fts/fts_query.h" +#include "mongo/db/fts/fts_query_impl.h" #include "mongo/db/fts/fts_spec.h" #include "mongo/db/fts/stemmer.h" #include "mongo/db/fts/stop_words.h" diff --git a/src/mongo/db/matcher/expression_text.cpp b/src/mongo/db/matcher/expression_text.cpp index b371357970d..8ee279efc1d 100644 --- a/src/mongo/db/matcher/expression_text.cpp +++ b/src/mongo/db/matcher/expression_text.cpp @@ -41,8 +41,8 @@ TextMatchExpression::TextMatchExpression(TextParams params) : TextMatchExpressionBase(std::move(params)) {} Status TextMatchExpression::init() { - // Validate language, but defer construction of FTSQuery (which requires access to the target - // namespace) until stage building time. + // Validate language, but defer construction of FTSQueryImpl (which requires access to the + // target namespace) until stage building time. if (!getLanguage().empty()) { if (!fts::FTSLanguage::make(getLanguage(), fts::TEXT_INDEX_VERSION_2).isOK()) { return {ErrorCodes::BadValue, "$language specifies unsupported language"}; diff --git a/src/mongo/db/query/query_solution.h b/src/mongo/db/query/query_solution.h index 8c21bc5a9f1..e3fd9d9dd3c 100644 --- a/src/mongo/db/query/query_solution.h +++ b/src/mongo/db/query/query_solution.h @@ -32,14 +32,14 @@ #include "mongo/db/jsobj.h" #include "mongo/db/matcher/expression.h" -#include "mongo/db/fts/fts_query.h" +#include "mongo/db/fts/fts_query_impl.h" #include "mongo/db/query/index_bounds.h" #include "mongo/db/query/plan_cache.h" #include "mongo/db/query/stage_types.h" namespace mongo { -using mongo::fts::FTSQuery; +using mongo::fts::FTSQueryImpl; class GeoNearExpression; |