text
command was deprecated in the 2.6
version of MongoDB. Use the $text
query operator instead. This class will not be removed
until two releases after the MongoDB 2.6 release (e.g. 2.10 if
the releases are 2.8 and 2.10).@Deprecated public class TextResult extends Object
text
command.
The result of a text
command is a document that looks like the
following:
> db.collection.runCommand( { "text": "collection" , search: "coffee magic" } ) { "queryDebugString" : "coffe|magic||||||", "language" : "english", "results" : [ { "score" : 2.25, "obj" : { "_id" : ObjectId("51376ab8602c316554cfe248"), "content" : "Coffee is full of magical powers." } }, { "score" : 0.625, "obj" : { "_id" : ObjectId("51376a80602c316554cfe246"), "content" : "Now is the time to drink all of the coffee." } } ], "stats" : { "nscanned" : 3, "nscannedObjects" : 0, "n" : 2, "nfound" : 2, "timeMicros" : 97 }, "ok" : 1 }
This class wraps a single entry from the results
array.
Constructor and Description |
---|
TextResult(DocumentAssignable document)
Deprecated.
Creates a new Text.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object object)
Deprecated.
|
Document |
getDocument()
Deprecated.
Returns the document.
|
Document |
getRawDocument()
Deprecated.
Returns the un-processed result document.
|
double |
getScore()
Deprecated.
Returns the score for the document.
|
int |
hashCode()
Deprecated.
|
public TextResult(DocumentAssignable document)
document
- The document containing the 'score' and 'obj' fields.AssertionError
- On the search term not being set.public boolean equals(Object object)
Overridden to compare equal to an equivalent text result.
public Document getDocument()
public Document getRawDocument()
public double getScore()
Copyright © 2011–2014 Allanbank Consulting, Inc.. All rights reserved.