diff options
author | Hari Khalsa <hkhalsa@10gen.com> | 2013-04-29 12:17:05 -0400 |
---|---|---|
committer | Hari Khalsa <hkhalsa@10gen.com> | 2013-05-02 15:57:13 -0400 |
commit | 41a2d01e419cabd2011ce4ce7262eb8b7181d9e7 (patch) | |
tree | 0bf766b83bda0090a853ec8d48e6c2f75d605d97 /src/mongo/db/fts | |
parent | fc76b559266c4e2aee0707e6d640c08d20ff9e55 (diff) | |
download | mongo-41a2d01e419cabd2011ce4ce7262eb8b7181d9e7.tar.gz |
SERVER-8791 SERVER-9212 retire indexplugin/indextype
Diffstat (limited to 'src/mongo/db/fts')
-rw-r--r-- | src/mongo/db/fts/SConscript | 1 | ||||
-rw-r--r-- | src/mongo/db/fts/fts_index.cpp | 96 | ||||
-rw-r--r-- | src/mongo/db/fts/fts_index.h | 64 | ||||
-rw-r--r-- | src/mongo/db/fts/fts_search.h | 1 |
4 files changed, 0 insertions, 162 deletions
diff --git a/src/mongo/db/fts/SConscript b/src/mongo/db/fts/SConscript index 6534b73bdc1..7fc9298de9b 100644 --- a/src/mongo/db/fts/SConscript +++ b/src/mongo/db/fts/SConscript @@ -47,7 +47,6 @@ env.StaticLibrary( 'server_common', [ env.StaticLibrary('ftsmongod', [ 'fts_command_mongod.cpp', - 'fts_index.cpp', 'fts_search.cpp', ], LIBDEPS=["base","server_common"]) diff --git a/src/mongo/db/fts/fts_index.cpp b/src/mongo/db/fts/fts_index.cpp deleted file mode 100644 index 0f6c3995fce..00000000000 --- a/src/mongo/db/fts/fts_index.cpp +++ /dev/null @@ -1,96 +0,0 @@ -// fts_index.cpp - -/** -* Copyright (C) 2012 10gen Inc. -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Affero General Public License, version 3, -* as published by the Free Software Foundation. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU Affero General Public License for more details. -* -* You should have received a copy of the GNU Affero General Public License -* along with this program. If not, see <http://www.gnu.org/licenses/>. -*/ - -#include "mongo/pch.h" - -#include "mongo/base/init.h" -#include "mongo/db/client.h" -#include "mongo/db/fts/fts_enabled.h" -#include "mongo/db/fts/fts_index.h" -#include "mongo/db/fts/fts_index_format.h" -#include "mongo/util/mongoutils/str.h" -#include "mongo/util/stringutils.h" -#include "mongo/util/timer.h" -#include "mongo/db/pdfile.h" - -namespace mongo { - - namespace fts { - - using namespace mongoutils; - - /* - * extrapolates the weights vector - * and extra information from the spec - * @param plugin the index plugin for FTS - * @param spec the index specification - */ - FTSIndex::FTSIndex( const IndexPlugin* plugin, const IndexSpec* spec ) - : IndexType( plugin, spec ), _ftsSpec( spec->info ) { - } - - void FTSIndex::getKeys( const BSONObj& obj, BSONObjSet& keys) const { - FTSIndexFormat::getKeys( _ftsSpec, obj, &keys ); - } - - - FTSIndexPlugin::FTSIndexPlugin() : IndexPlugin( INDEX_NAME ) {} - - - /* - * Adjusts spec by appending information relative to the - * FTS Index (such as weights, index name, etc) - * @param spec, specification object - * - */ - BSONObj FTSIndexPlugin::adjustIndexSpec( const BSONObj& spec ) const { - StringData desc = cc().desc(); - if ( desc.find( "conn" ) == 0 ) { - // this is to make sure we only complain for users - // if you do get a text index created an a primary - // want it to index on the secondary as well - massert( 16633, "text search not enabled", isTextSearchEnabled() ); - } - return FTSSpec::fixSpec( spec ); - } - - /* - * Generates an FTSIndex with a spec and this plugin - * @param spec, specification to be used - */ - IndexType* FTSIndexPlugin::generate( const IndexSpec* spec ) const { - return new FTSIndex( this, spec ); - } - - void FTSIndexPlugin::postBuildHook( const IndexSpec& spec ) const { - string ns = spec.getDetails()->parentNS(); - NamespaceDetails* nsd = nsdetails( ns ); - if ( nsd->setUserFlag( NamespaceDetails::Flag_UsePowerOf2Sizes ) ) { - nsd->syncUserFlags( ns ); - } - } - - FTSIndexPlugin* ftsPlugin; - MONGO_INITIALIZER(FTSIndexPlugin)(InitializerContext* context) { - ftsPlugin = new FTSIndexPlugin(); - return Status::OK(); - } - - } - -} diff --git a/src/mongo/db/fts/fts_index.h b/src/mongo/db/fts/fts_index.h deleted file mode 100644 index a6a1378672f..00000000000 --- a/src/mongo/db/fts/fts_index.h +++ /dev/null @@ -1,64 +0,0 @@ -// fts_index.h - -/** -* Copyright (C) 2012 10gen Inc. -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Affero General Public License, version 3, -* as published by the Free Software Foundation. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU Affero General Public License for more details. -* -* You should have received a copy of the GNU Affero General Public License -* along with this program. If not, see <http://www.gnu.org/licenses/>. -*/ - -#pragma once - -#include <map> -#include <vector> - -#include "mongo/db/fts/fts_spec.h" -#include "mongo/db/fts/fts_util.h" -#include "mongo/db/fts/stemmer.h" -#include "mongo/db/fts/stop_words.h" -#include "mongo/db/fts/tokenizer.h" -#include "mongo/db/index.h" - -namespace mongo { - - namespace fts { - - class FTSIndex : public IndexType { - public: - - // index constructor, called when user enters ensureIndex command with fts flag - FTSIndex(const IndexPlugin *plugin, const IndexSpec* spec); - - void getKeys( const BSONObj& obj, BSONObjSet& keys) const; - - const FTSSpec& getFtsSpec() const { return _ftsSpec; } - - private: - - FTSSpec _ftsSpec; - }; - - - class FTSIndexPlugin : public IndexPlugin { - public: - FTSIndexPlugin(); - - IndexType* generate( const IndexSpec* spec ) const; - - BSONObj adjustIndexSpec( const BSONObj& spec ) const; - - void postBuildHook( const IndexSpec& spec ) const; - - }; - - } //namespace fts -} //namespace mongo diff --git a/src/mongo/db/fts/fts_search.h b/src/mongo/db/fts/fts_search.h index 6d6c4c09f5f..9bc2ede77c0 100644 --- a/src/mongo/db/fts/fts_search.h +++ b/src/mongo/db/fts/fts_search.h @@ -24,7 +24,6 @@ #include <queue> #include "mongo/base/disallow_copying.h" -#include "mongo/db/fts/fts_index.h" #include "mongo/db/fts/fts_matcher.h" #include "mongo/db/fts/fts_query.h" #include "mongo/db/fts/fts_util.h" |