-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 2.4.1
-
Component/s: Text Search
-
None
-
ALL
The query parser generates the phrase list from the token stream, separating tokens with spaces. The phrase matcher performs a byte-by-byte comparison to determine a match (post-lowercasing). Thus, the only documents that will be returned in a phrase match are documents in which the phrase tokens are space-delimited.
See, for example:
> db.foo.ensureIndex({a:"text"},{default_language:"none"}) > db.foo.find() { "_id" : ObjectId("515b316ed8714740e78cf351"), "a" : "foo-bar" } { "_id" : ObjectId("515b3170d8714740e78cf352"), "a" : "foo.bar" } { "_id" : ObjectId("515b3172d8714740e78cf353"), "a" : "foo+bar" } { "_id" : ObjectId("515b3174d8714740e78cf354"), "a" : "foo/bar" } { "_id" : ObjectId("515b31e3d8714740e78cf355"), "a" : "foo, bar" } { "_id" : ObjectId("515b31e5d8714740e78cf356"), "a" : "foo bar" } > db.foo.runCommand("text",{search:'"foo-bar"'}).results.length 0 > db.foo.runCommand("text",{search:'"foo.bar"'}).results.length 0 > db.foo.runCommand("text",{search:'"foo+bar"'}).results.length 0 > db.foo.runCommand("text",{search:'"foo/bar"'}).results.length 0 > db.foo.runCommand("text",{search:'"foo, bar"'}).results.length 0 > db.foo.runCommand("text",{search:'"foo bar"'}).results.length 0 > db.foo.runCommand("text",{search:'"foo bar"'}).results.length 0
All of the above searches yield queryDebugString "bar|foo||||foo bar||"
- is duplicated by
-
SERVER-9413 Text search seems to support solely alpha characters
- Closed