summaryrefslogtreecommitdiff
path: root/src/mongo/db/fts/stop_words.cpp
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2015-04-01 14:34:39 -0400
committerMark Benvenuto <mark.benvenuto@mongodb.com>2015-04-01 14:58:13 -0400
commit72598f750d732c08c98f5f578bf1335acd78e10e (patch)
treed80364b07b25210f5724ba6e6506650be657c74e /src/mongo/db/fts/stop_words.cpp
parent3cf0c18aa2c56949fda47ab35570489d68965370 (diff)
downloadmongo-72598f750d732c08c98f5f578bf1335acd78e10e.tar.gz
SERVER-17520: Add support for pluggable FTS tokenizers
Diffstat (limited to 'src/mongo/db/fts/stop_words.cpp')
-rw-r--r--src/mongo/db/fts/stop_words.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/mongo/db/fts/stop_words.cpp b/src/mongo/db/fts/stop_words.cpp
index 66240a1ce2d..421bfae63db 100644
--- a/src/mongo/db/fts/stop_words.cpp
+++ b/src/mongo/db/fts/stop_words.cpp
@@ -28,7 +28,6 @@
* it in the license file.
*/
-#include <boost/shared_ptr.hpp>
#include <set>
#include <string>
@@ -37,18 +36,14 @@
#include "mongo/base/init.h"
#include "mongo/util/string_map.h"
-
-
namespace mongo {
- using boost::shared_ptr;
-
namespace fts {
void loadStopWordMap( StringMap< std::set< std::string > >* m );
namespace {
- StringMap< boost::shared_ptr<StopWords> > STOP_WORDS;
+ StringMap< std::shared_ptr<StopWords> > StopWordsMap;
StopWords empty;
}
@@ -61,9 +56,9 @@ namespace mongo {
_words.insert( *i );
}
- const StopWords* StopWords::getStopWords( const FTSLanguage& language ) {
- StringMap< boost::shared_ptr<StopWords> >::const_iterator i = STOP_WORDS.find( language.str() );
- if ( i == STOP_WORDS.end() )
+ const StopWords* StopWords::getStopWords( const FTSLanguage* language ) {
+ auto i = StopWordsMap.find( language->str() );
+ if ( i == StopWordsMap.end() )
return &empty;
return i->second.get();
}
@@ -75,7 +70,7 @@ namespace mongo {
for ( StringMap< std::set< std::string > >::const_iterator i = raw.begin();
i != raw.end();
++i ) {
- STOP_WORDS[i->first].reset(new StopWords( i->second ));
+ StopWordsMap[i->first].reset(new StopWords( i->second ));
}
return Status::OK();
}