-
Type:
Bug
-
Resolution: Done
-
Priority:
Minor - P4
-
Affects Version/s: 2.5.4
-
Component/s: Text Search
-
ALL
-
None
-
0
-
None
-
None
-
None
-
None
-
None
-
None
In the spec it says:
Examples of sorts disallowed by the grammar:
{“x.y”: {$meta: “text”}}Examples invalid queries with a $meta sort (where a corresponding $meta projection is not correctly specified):
db.collection.find({$text: {$search: “hello”}, {t: {$meta: “text”}}).sort({s: {$meta: “text”}})
Yet this appears to work (and sort using the text metadata):
> db.test.find( { $text: {$search: "tyler" }}, {s: {$meta: "text"}}).sort({"WRONG.\^$.$$$": {$meta: "text"}} ) { "words" : "tyler brock", "cool" : true, "s" : 0.75 } { "words" : "tyler brock awesome cool", "s" : 0.625 } { "words" : "tyler brock cool cool", "s" : 0.625 }