Hello!
Please help me with the full text index in MongoDB.
> db.ftsc.insert({"name":"10pisem+1"}); > db.ftsc.insert({"name":"20pisem+1"}); > db.ftsc.insert({"name":"20pisem 2 письма"}); > db.ftsc.insert({"name":"20pisem 2 письмо"}); > > db.ftsc.ensureIndex({"name":"text"}); > > db.ftsc.find( { $text: { $search: "письм" } } ); // результат 0, хотя я ожидал 2 записи > > db.ftsc.find( { $text: { $search: "письмо" } } ); { "_id" : ObjectId("53ba8e56fd2bc6bd8af53531"), "name" : "20pisem 2 письмо" } > > db.ftsc.find( { $text: { $search: "pis" } } ); // результат 0 > > db.ftsc.find( { $text: { $search: "1" } } ); { "_id" : ObjectId("53ba8e35fd2bc6bd8af5352f"), "name" : "20pisem+1" } { "_id" : ObjectId("53ba8e23fd2bc6bd8af5352e"), "name" : "10pisem+1" } > > db.ftsc.find( { $text: { $search: "10" } } ); //результат 0 > > db.ftsc.find( { $text: { $search: "m+1" } } ); { "_id" : ObjectId("53ba8e35fd2bc6bd8af5352f"), "name" : "20pisem+1" } { "_id" : ObjectId("53ba8e23fd2bc6bd8af5352e"), "name" : "10pisem+1" } > > db.ftsc.find( { $text: { $search: "m+" } } ); // результат 0
How to properly adjust the index, what would it look for by occurrences of the substring?
PS: do not use regular expressions.