Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3.2
    • Component/s: Indexing, Querying
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible

      Description

      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
      }

        Attachments

          Issue Links

            Activity

              Dates

              • Created:
                Updated:
                Resolved: