summaryrefslogtreecommitdiff
path: root/src/mongo/db/fts/fts_index_format_test.cpp
diff options
context:
space:
mode:
authorJason Rassi <rassi@10gen.com>2013-03-12 10:30:21 -0400
committerJason Rassi <rassi@10gen.com>2013-03-12 10:36:22 -0400
commitd4193ba12b50954ede6bab1594696769893dfb13 (patch)
tree10b7985ab2a254e7dd20d40184252abc9e9383d2 /src/mongo/db/fts/fts_index_format_test.cpp
parent34f01531077d1843c1277303a5ce94dcb8bdba63 (diff)
downloadmongo-d4193ba12b50954ede6bab1594696769893dfb13.tar.gz
SERVER-8873 Correctly decide if a term in a text field is a stopword
Diffstat (limited to 'src/mongo/db/fts/fts_index_format_test.cpp')
-rw-r--r--src/mongo/db/fts/fts_index_format_test.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mongo/db/fts/fts_index_format_test.cpp b/src/mongo/db/fts/fts_index_format_test.cpp
index 7b0f5b32f0a..5ef27dd83f5 100644
--- a/src/mongo/db/fts/fts_index_format_test.cpp
+++ b/src/mongo/db/fts/fts_index_format_test.cpp
@@ -91,6 +91,18 @@ namespace mongo {
ASSERT( i.next().numberDouble() > 0 );
}
+ TEST( FTSIndexFormat, StopWords1 ) {
+ FTSSpec spec( FTSSpec::fixSpec( BSON( "key" << BSON( "data" << "text" ) ) ) );
+
+ BSONObjSet keys1;
+ FTSIndexFormat::getKeys( spec, BSON( "data" << "computer" ), &keys1 );
+ ASSERT_EQUALS( 1U, keys1.size() );
+
+ BSONObjSet keys2;
+ FTSIndexFormat::getKeys( spec, BSON( "data" << "any computer" ), &keys2 );
+ ASSERT_EQUALS( 1U, keys2.size() );
+ }
+
}
}