-
Type:
New Feature
-
Resolution: Done
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: Index Maintenance, Querying
-
None
-
Fully Compatible
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Simple text indexing.
Initial version will be marked as experimental, so has to be turned on with a command line flag or at runtime.
db.adminCommand( { setParameter : "*", textSearchEnabled : true } );
OR
./mongod --setParameter textSearchEnabled=true
Only works via "text" command currently.
Features:
- parsing + stemming for latin languages
- multi-word scoring
- phrase matching
- word negation
- weights per field
- additional suffix index fields for coverings
- additional prefix index fields for partitioning
- specify language per document
Simple Example:
> db.foo.insert( { _id: 1 , desc: "the dog is running" } )
> db.foo.insert( { _id: 2 , desc: "the cat is walking" } )
> db.foo.ensureIndex( { "desc": "text" } )
> db.foo.runCommand( "text", { search : "walk" } )
{
"queryDebugString" : "walk||||||",
"language" : "english",
"results" : [
{
"score" : 0.75,
"obj" : {
"_id" : 2,
"desc" : "the cat is walking"
}
}
],
"stats" : {
"nscanned" : 1,
"nscannedObjects" : 0,
"n" : 1,
"timeMicros" : 330
},
"ok" : 1
}
- is depended on by
-
SERVER-1635 Faceting support
-
- Closed
-