Details
-
Improvement
-
Resolution: Done
-
Major - P3
-
None
-
None
-
Windows 7, Linux 14.10, Linux 12.10
*Location*: http://docs.mongodb.org/manual/core/index-text/#text-search
*User-Agent*: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36
*Screen Resolution*: 1920 x 1080
*repo*: docs
*source*: core/index-text
Windows 7, Linux 14.10, Linux 12.10 *Location*: http://docs.mongodb.org/manual/core/index-text/#text-search *User-Agent*: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36 *Screen Resolution*: 1920 x 1080 *repo*: docs *source*: core/index-text
Description
I have reported an error previously here: https://jira.mongodb.org/browse/DOCS-3863
Key kim close the ticket saying me this:
Hi Claudio –
thanks for taking the time to file this ticket with very clear examples.
The text search matches on the complete stemmed words. For example, if a document field contains the word blueberry, a search on the term blue will not match the document.
So, for your example, I believe the complete stemmed word for textt is textt and the stemmed search term for text is text and since the match is on the complete stemmed word, the two will not match.
For more information, refer to http://docs.mongodb.org/manual/core/index-text/#text-search
The things, Key Kim is wrong..
In mongodb 2.6.3 you can search a word, for example, if you have the following documents:
db.foo.find({});
{ "_id" : ObjectId("53dfd9453e1e4201402d2f5b"), "desc" : "This is a bug textt" } { "_id" : ObjectId("53dfd9453e1e4201402d2f5b"), "desc" : "Text" } { "_id" : ObjectId("53dfd9453e1e4201402d2f5b"), "desc" : "I wrote a text" } { "_id" : ObjectId("53dfd9453e1e4201402d2f5d"), "desc" : "This is a string with text" }and you have a "text" index for desc
db.foo.ensureIndex(
{"desc":"text"});
And you make this query finding text:
db.foo.find({$text:{ $search:"text" }});
You will get:
{ "_id" : ObjectId("53dfd9453e1e4201402d2f5b"), "desc" : "Text" } { "_id" : ObjectId("53dfd9453e1e4201402d2f5b"), "desc" : "I wrote a text" } { "_id" : ObjectId("53dfd9453e1e4201402d2f5d"), "desc" : "This is a string with text" }Notice that the document:
{ "_id" : ObjectId("53dfd9453e1e4201402d2f5b"), "desc" : "This is a bug textt" }has not been received.
I try this with the fallowing cases..
I added many documents with this text string into a differents phrases..
walk — walkk
text ----- textt
hello — helloo
name – namee
I thing the bug here is the double character in the end fo the key string or somelike that.
I don't know for what reason Kim told me that this can't be done with mongo, I make all this querys on shell of mongo 2.6.3,
Best
C
PD: For more details I found this ticket: https://jira.mongodb.org/browse/SERVER-380 where Jason Rassi says that the feature has been deployed in version of 2.6.3
PD: And sorry for my english.