diff options
Diffstat (limited to 'src/mongo/db/fts')
-rw-r--r-- | src/mongo/db/fts/fts_command.h | 14 | ||||
-rw-r--r-- | src/mongo/db/fts/fts_index_format.h | 8 | ||||
-rw-r--r-- | src/mongo/db/fts/fts_language.h | 8 | ||||
-rw-r--r-- | src/mongo/db/fts/fts_matcher.h | 6 | ||||
-rw-r--r-- | src/mongo/db/fts/fts_query.h | 28 | ||||
-rw-r--r-- | src/mongo/db/fts/fts_spec.h | 14 |
6 files changed, 39 insertions, 39 deletions
diff --git a/src/mongo/db/fts/fts_command.h b/src/mongo/db/fts/fts_command.h index 4dc84bfb6e8..4c0ced7efea 100644 --- a/src/mongo/db/fts/fts_command.h +++ b/src/mongo/db/fts/fts_command.h @@ -56,24 +56,24 @@ namespace mongo { std::vector<Privilege>* out); - bool run(OperationContext* txn, const string& dbname, + bool run(OperationContext* txn, const std::string& dbname, BSONObj& cmdObj, int options, - string& errmsg, + std::string& errmsg, BSONObjBuilder& result, bool fromRepl); protected: - bool _run( const string& dbName, + bool _run( const std::string& dbName, BSONObj& cmdObj, int cmdOptions, - const string& ns, - const string& searchString, - string language, // "" for not-set + const std::string& ns, + const std::string& searchString, + std::string language, // "" for not-set int limit, BSONObj& filter, BSONObj& projection, - string& errmsg, + std::string& errmsg, BSONObjBuilder& result ); }; diff --git a/src/mongo/db/fts/fts_index_format.h b/src/mongo/db/fts/fts_index_format.h index e7d64bc0479..75084e822ad 100644 --- a/src/mongo/db/fts/fts_index_format.h +++ b/src/mongo/db/fts/fts_index_format.h @@ -46,12 +46,12 @@ namespace mongo { /* * Helper method to get return entry from the FTSIndex as a BSONObj * @param weight, the weight of the term in the entry - * @param term, the string term in the entry + * @param term, the std::string term in the entry * @param indexPrefix, the fields that go in the index first * @param textIndexVersion, index version. affects key format. */ static BSONObj getIndexKey( double weight, - const string& term, + const std::string& term, const BSONObj& indexPrefix, TextIndexVersion textIndexVersion ); @@ -60,10 +60,10 @@ namespace mongo { * Helper method to get return entry from the FTSIndex as a BSONObj * @param b, reference to the BSONOBjBuilder * @param weight, the weight of the term in the entry - * @param term, the string term in the entry + * @param term, the std::string term in the entry * @param textIndexVersion, index version. affects key format. */ - static void _appendIndexKey( BSONObjBuilder& b, double weight, const string& term, + static void _appendIndexKey( BSONObjBuilder& b, double weight, const std::string& term, TextIndexVersion textIndexVersion ); }; diff --git a/src/mongo/db/fts/fts_language.h b/src/mongo/db/fts/fts_language.h index 3a7a471bc32..5877c8a2756 100644 --- a/src/mongo/db/fts/fts_language.h +++ b/src/mongo/db/fts/fts_language.h @@ -71,13 +71,13 @@ namespace mongo { FTSLanguage(); /** - * Returns the language as a string in canonical form (lowercased English name). It is + * Returns the language as a std::string in canonical form (lowercased English name). It is * an error to call str() on an uninitialized language. */ const std::string& str() const; /** - * Register string 'languageName' as a new language with text index version + * Register std::string 'languageName' as a new language with text index version * 'textIndexVersion'. Saves the resulting language to out-argument 'languageOut'. * Subsequent calls to FTSLanguage::make() will recognize the newly-registered language * string. @@ -97,7 +97,7 @@ namespace mongo { /** * Return the FTSLanguage associated with the given language string. Returns an error - * Status if an invalid language string is passed. + * Status if an invalid language std::string is passed. * * For textIndexVersion=TEXT_INDEX_VERSION_2, language strings are * case-insensitive, and need to be in one of the two following forms: @@ -114,7 +114,7 @@ namespace mongo { TextIndexVersion textIndexVersion ); private: - // String representation of language in canonical form. + // std::string representation of language in canonical form. std::string _canonicalName; }; diff --git a/src/mongo/db/fts/fts_matcher.h b/src/mongo/db/fts/fts_matcher.h index d32a92d11f9..3e3b971ddc3 100644 --- a/src/mongo/db/fts/fts_matcher.h +++ b/src/mongo/db/fts/fts_matcher.h @@ -52,7 +52,7 @@ namespace mongo { * so all full phrases and no negated */ bool phrasesMatch( const BSONObj& obj ) const; - bool phraseMatch( const string& phrase, const BSONObj& obj ) const; + bool phraseMatch( const std::string& phrase, const BSONObj& obj ) const; bool matchesNonTerm( const BSONObj& obj ) const { return !hasNegativeTerm( obj ) && phrasesMatch( obj ); @@ -62,12 +62,12 @@ namespace mongo { /** * @return true if raw has a negated term */ - bool _hasNegativeTerm_string( const FTSLanguage* language, const string& raw ) const; + bool _hasNegativeTerm_string( const FTSLanguage* language, const std::string& raw ) const; /** * @return true if raw has a phrase */ - bool _phraseMatches( const string& phrase, const string& raw ) const; + bool _phraseMatches( const std::string& phrase, const std::string& raw ) const; FTSQuery _query; FTSSpec _spec; diff --git a/src/mongo/db/fts/fts_query.h b/src/mongo/db/fts/fts_query.h index 953bdf15daf..1d8146c2ddc 100644 --- a/src/mongo/db/fts/fts_query.h +++ b/src/mongo/db/fts/fts_query.h @@ -49,13 +49,13 @@ namespace mongo { class FTSQuery { public: - Status parse(const string& query, const StringData& language); + Status parse(const std::string& query, const StringData& language); - const vector<string>& getTerms() const { return _terms; } - const set<string>& getNegatedTerms() const { return _negatedTerms; } + const std::vector<std::string>& getTerms() const { return _terms; } + const std::set<std::string>& getNegatedTerms() const { return _negatedTerms; } - const vector<string>& getPhr() const { return _phrases; } - const vector<string>& getNegatedPhr() const { return _negatedPhrases; } + const std::vector<std::string>& getPhr() const { return _phrases; } + const std::vector<std::string>& getNegatedPhr() const { return _negatedPhrases; } /** * @return true if any negations or phrase + or - @@ -67,25 +67,25 @@ namespace mongo { _negatedPhrases.size() > 0; } - string getSearch() const { return _search; } + std::string getSearch() const { return _search; } const FTSLanguage& getLanguage() const { return *_language; } - string toString() const; + std::string toString() const; - string debugString() const; + std::string debugString() const; BSONObj toBSON() const; protected: - string _search; + std::string _search; const FTSLanguage* _language; - vector<string> _terms; - set<string> _negatedTerms; - vector<string> _phrases; - vector<string> _negatedPhrases; + std::vector<std::string> _terms; + std::set<std::string> _negatedTerms; + std::vector<std::string> _phrases; + std::vector<std::string> _negatedPhrases; private: - void _addTerm( const StopWords* sw, Stemmer& stemmer, const string& term, bool negated ); + void _addTerm( const StopWords* sw, Stemmer& stemmer, const std::string& term, bool negated ); }; } diff --git a/src/mongo/db/fts/fts_spec.h b/src/mongo/db/fts/fts_spec.h index 8bc47fcbaad..7f6365002fb 100644 --- a/src/mongo/db/fts/fts_spec.h +++ b/src/mongo/db/fts/fts_spec.h @@ -49,8 +49,8 @@ namespace mongo { extern const double MAX_WORD_WEIGHT; extern const double DEFAULT_WEIGHT; - typedef std::map<string,double> Weights; // TODO cool map - typedef unordered_map<string,double> TermFrequencyMap; + typedef std::map<std::string,double> Weights; // TODO cool map + typedef unordered_map<std::string,double> TermFrequencyMap; struct ScoreHelperStruct { ScoreHelperStruct() @@ -60,7 +60,7 @@ namespace mongo { double count; double exp; }; - typedef unordered_map<string,ScoreHelperStruct> ScoreHelperMap; + typedef unordered_map<std::string,ScoreHelperStruct> ScoreHelperMap; class FTSSpec { @@ -82,7 +82,7 @@ namespace mongo { bool wildcard() const { return _wildcard; } const FTSLanguage& defaultLanguage() const { return *_defaultLanguage; } - const string& languageOverrideField() const { return _languageOverrideField; } + const std::string& languageOverrideField() const { return _languageOverrideField; } size_t numExtraBefore() const { return _extraBefore.size(); } const std::string& extraBefore( unsigned i ) const { return _extraBefore[i]; } @@ -161,17 +161,17 @@ namespace mongo { TextIndexVersion _textIndexVersion; const FTSLanguage* _defaultLanguage; - string _languageOverrideField; + std::string _languageOverrideField; bool _wildcard; // mapping : fieldname -> weight Weights _weights; // Prefix compound key - used to partition search index - std::vector<string> _extraBefore; + std::vector<std::string> _extraBefore; // Suffix compound key - used for covering index behavior - std::vector<string> _extraAfter; + std::vector<std::string> _extraAfter; }; } |