[SERVER-12081] Text search matcher can incorrectly match documents if multi-language or contain text-indexed nested arrays Created: 13/Dec/13  Updated: 11/Jul/16  Resolved: 30/Jan/14

Status: Closed
Project: Core Server
Component/s: Text Search
Affects Version/s: 2.5.4
Fix Version/s: None

Type: Bug Priority: Critical - P2
Reporter: J Rassi Assignee: J Rassi
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-12162 Update fts_matcher to use sub-documen... Closed
Operating System: ALL
Participants:

 Description   

textIndexVersion:2 indexes observe subdocument language annotations (and correctly index nested arrays, if not directly nested). The text search matcher needs to invoke the correct language stemmer on text contained in subdocuments (and examine fields in nested arrays for determining a match), but doesn't.

Reproduce with:

> db.foo.ensureIndex({"a.b":"text"})
> db.foo.insert({a:[{b:["example content"]}]}) // note indexed nested arrays
Insert WriteResult({ "ok" : 1, "n" : 1 })
> db.foo.find({$text:{$search:"example content"}}) // correct
{ "_id" : ObjectId("52aa57a0ae39c4212eb00625"), "a" : [ { "b" : [ "example content" ] } ] }
> db.foo.find({$text:{$search:"example -content"}}) // incorrect: should return empty result set
{ "_id" : ObjectId("52aa57a0ae39c4212eb00625"), "a" : [ { "b" : [ "example content" ] } ] }
> db.foo.find({$text:{$search:"example \"content\""}}) // incorrect: should not return empty result set
>



 Comments   
Comment by Githook User [ 30/Jan/14 ]

Author:

{u'username': u'jrassi', u'name': u'Jason Rassi', u'email': u'rassi@10gen.com'}

Message: SERVER-12081 Move fts_iterator.

{cpp,h} => fts_element_iterator.{cpp,h}

Branch: master
https://github.com/mongodb/mongo/commit/e97ed96f1726248d826d29feaf7fbaa5ec01ec9a

Comment by Githook User [ 30/Jan/14 ]

Author:

{u'username': u'jrassi', u'name': u'Jason Rassi', u'email': u'rassi@10gen.com'}

Message: SERVER-12081 Formatting for FTSElementIterator class declaration
Branch: master
https://github.com/mongodb/mongo/commit/c4d95daf2de9b85f0282f2113f33bee64245467c

Comment by Githook User [ 29/Jan/14 ]

Author:

{u'name': u'Paul Pedersen', u'email': u'paulpedersen@Pauls-MacBook-Pro.local'}

Message: SERVER-12081 fts_iterator implementation
Branch: master
https://github.com/mongodb/mongo/commit/8afbec33f4de266a552f50c608621053523a7a15

Generated at Thu Feb 08 03:27:33 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.