-
Type:
Bug
-
Resolution: Done
-
Priority:
Major - P3
-
None
-
Affects Version/s: 2.4.4
-
Component/s: Text Search
-
None
-
ALL
-
None
-
3
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Hi all,
I'm using MongoDB text search, and I'd like to give some feedback. I'm not sure what the best way is to do so, so I've made this report. If there's a more preferred way, please let me know, so I can use that way in the future.
Based on this document: http://docs.mongodb.org/manual/tutorial/create-text-index-on-multi-language-collection/, I've made some testcase, and I don't understand what's happening.
This is my test data:
{ "_id" : 1, "language" : "portuguese", "quote" : "A sorte protege os audazes" } { "_id" : 2, "language" : "spanish", "quote" : "Nada hay más surreal que la realidad." } { "_id" : 3, "language" : "english", "quote" : "is this a dagger which I see before me" } { "_id" : 4, "language" : "dutch", "quote" : "is dit een dolk die ik voor mij zie" } { "_id" : 5, "language" : "dutch", "quote" : "vol verbijstering zaten de dames naar de twee honden te kijken" }
And I'm most interested in finding the Dutch results right now.
My question is: why do I have to specify a language when searching, when the language is already in the document. I would consider my User Interface to contain a text field which is used for searching, like Google, without having to specify a name. In most cases, I don't know the language the user is searching for, and assuming English gives weird results:
> db.quotes.runCommand( "text", { search: "honden", language:"dutch" } ) Correct result: 1 > db.quotes.runCommand( "text", { search: "hond", language:"dutch" } ) Correct result: 1 > db.quotes.runCommand( "text", { search: "hond" } ) Correct(?) result: 1 > db.quotes.runCommand( "text", { search: "honden" } ) Incorrect(?) result: 0 results found
I'd like to search using a search term, but don't specify the search language when searching for a term, since I'll never know the language the user is looking for. If this is not possible, this feature is useless for me, unless I'm overlooking something here?