@@ -52,21 +52,35 @@ Text Indexes
52
52
Background
53
53
``````````
54
54
55
- MongoDB 2.3.2 added a new ``text`` index type that creates a special
56
- index that allows rich arbitrary queries over the content of a string
57
- field in MongoDB. MongoDB updates ``text`` indexes in real time as
58
- clients update data in MongoDB. Queries that use the ``text`` index
59
- will always be able to find the latest data using the text index.
55
+ MongoDB2.3.2 includes a new ``text`` index type. ``text`` indexes
56
+ support boolean text search queries. Any set of fields containing
57
+ string data may be text indexed. You may only maintain a single
58
+ ``text`` index per collection. ``text`` indexes are fully consistent
59
+ and updated in real-time as applications insert, update, or delete
60
+ documents from the database. The ``text`` index and query system
61
+ supports language specific stemming and stop-words. Additionally:
62
+
63
+ - indexes and queries drop stop words (i.e. "the," "an," "a," "and,"
64
+ etc.)
65
+
66
+ - MongoDB stores words stemmed during insertion in the index, using
67
+ simple suffix stemming, including support for a number of
68
+ languages. MongoDB automatically stems :dbcommand:`text` queries at
69
+ before beginning the query.
60
70
61
71
However, ``text`` indexes have large storage requirements and incur
62
72
**significant** performance costs:
63
73
64
- - Building ``text`` indexes takes time. For larger data sets, it may
65
- take many minutes or hours to build a text index .
74
+ - Text indexes can be large. They contain one index entry for each
75
+ unique word indexed for each document inserted .
66
76
67
- - ``text`` indexes will impede insertion throughput for collection, as
68
- MongoDB must update index entries for each word in the source
69
- collection.
77
+ - Building a ``text`` index is very similar to building a large
78
+ multi-key index, and therefore may take longer than building a
79
+ simple ordered (scalar)index.
80
+
81
+ - ``text`` indexes will impede insertion throughput, because MongoDB
82
+ must add an index entry for each unique word in each indexed field
83
+ of each new source document.
70
84
71
85
- some :dbcommand:`text` searches may affect performance on your
72
86
:program:`mongod`, particularly for negation queries and phrase
@@ -76,21 +90,10 @@ However, ``text`` indexes have large storage requirements and incur
76
90
Additionally, the current *experimental* implementation of ``text``
77
91
indexes have the following limitations and behaviors:
78
92
79
- - MongoDB stores words stemmed during insertion in the index, using
80
- simple suffix stemming, including support for a number of
81
- languages. MongoDB automatically stems :dbcommand:`text` queries at
82
- before beginning the query.
83
-
84
- - indexes and queries drop stop words (i.e. "the," "an," "a," "and,"
85
- etc.)
86
-
87
- - the index does not store phrases or information about the proximity
88
- of words in the documents. As a result, **only** use phrase queries
89
- when the entire collection fits in RAM.
90
-
91
- - :dbcommand:`text` queries with negations must scan the content of
92
- the document to guarantee the negation. As a result, **only** use
93
- phrase queries when the entire collection fits in RAM.
93
+ - ``text`` indexes do not store phrases or information about the
94
+ proximity of words in the documents. As a result, phrase queries
95
+ will run much more effectively when the entire collection fits in
96
+ RAM.
94
97
95
98
- MongoDB does not stem phrases or negations in :dbcommand:`text`
96
99
queries.
@@ -100,10 +103,12 @@ indexes have the following limitations and behaviors:
100
103
.. important:: Do not enable or use ``text`` indexes on production
101
104
systems.
102
105
103
- For production-grade search requirements consider using a third-party
104
- search tool, and the `mongo-connector <https://github.com/10gen-labs/mongo-connector>`_
105
- or a similar integration strategy to provide more advanced search
106
- capabilities.
106
+ .. May be worth including this:
107
+
108
+ For production-grade search requirements consider using a
109
+ third-party search tool, and the `mongo-connector
110
+ <https://github.com/10gen-labs/mongo-connector>`_ or a similar
111
+ integration strategy to provide more advanced search capabilities.
107
112
108
113
Test ``text`` Indexes
109
114
`````````````````````
0 commit comments