diff --git a/doc/api/pymongo/collection.rst b/doc/api/pymongo/collection.rst index 3152c3c7e..1b313a9ab 100644 --- a/doc/api/pymongo/collection.rst +++ b/doc/api/pymongo/collection.rst @@ -8,7 +8,6 @@ .. autodata:: pymongo.DESCENDING .. autodata:: pymongo.GEO2D .. autodata:: pymongo.GEOHAYSTACK - .. autodata:: pymongo.TEXT .. autoclass:: pymongo.collection.Collection(database, name[, create=False[, **kwargs]]]) diff --git a/pymongo/__init__.py b/pymongo/__init__.py index b0f8b2029..2067c5519 100644 --- a/pymongo/__init__.py +++ b/pymongo/__init__.py @@ -40,15 +40,6 @@ GEOHAYSTACK = "geoHaystack" .. _haystack index: http://docs.mongodb.org/manual/core/geospatial-indexes/#haystack-indexes """ -TEXT = "text" -"""Index specifier for text search. - -.. versionadded:: 2.4.2 - -.. note:: Text search requires server version **>= 2.3.2**. -""" - - OFF = 0 """No database profiling.""" SLOW_ONLY = 1 diff --git a/pymongo/helpers.py b/pymongo/helpers.py index c732164b8..3ed00a53d 100644 --- a/pymongo/helpers.py +++ b/pymongo/helpers.py @@ -69,9 +69,9 @@ def _index_document(index_list): if not isinstance(key, basestring): raise TypeError("first item in each key pair must be a string") if not isinstance(value, (basestring, int)): - raise TypeError("second item in each key pair must be ASCENDING, " - "DESCENDING, GEO2D, GEOHAYSTACK, TEXT, or other " - "valid MongoDB index specifier.") + raise TypeError("second item in each key pair must be 1, -1, " + "'2d', 'geoHaystack', or another valid MongoDB " + "index specifier.") index[key] = value return index diff --git a/test/test_collection.py b/test/test_collection.py index 80459fd01..05d76f924 100644 --- a/test/test_collection.py +++ b/test/test_collection.py @@ -33,7 +33,7 @@ from bson.code import Code from bson.objectid import ObjectId from bson.py3compat import b from bson.son import SON -from pymongo import ASCENDING, DESCENDING, GEO2D, GEOHAYSTACK, TEXT +from pymongo import ASCENDING, DESCENDING, GEO2D, GEOHAYSTACK from pymongo.collection import Collection from pymongo.son_manipulator import SONManipulator from pymongo.errors import (ConfigurationError, @@ -387,7 +387,7 @@ class TestCollection(unittest.TestCase): }, results[0]) def test_index_text(self): - if not version.at_least(self.connection, (2, 3, 2, -1)): + if not version.at_least(self.connection, (2, 3, 2)): raise SkipTest("Text search requires server >=2.3.2.") self.connection.admin.command('setParameter', '*', @@ -395,7 +395,7 @@ class TestCollection(unittest.TestCase): db = self.db db.test.drop_indexes() - self.assertEqual("t_text", db.test.create_index([("t", TEXT)])) + self.assertEqual("t_text", db.test.create_index([("t", "text")])) index_info = db.test.index_information()["t_text"] self.assertTrue("weights" in index_info) db.test.drop_indexes()