-
Type: Task
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
Text search has been made official as of version 2.6 of mongodb and it appears that it's almost possible to use it by building a Criteria as follows:
Model.where(
:$text => {:$search => "search string", :$language => "en"}
)
However the ruby driver is lacking an api to set the $meta flag on projection field (second argument of db.collection.find(...)), which required to sort by the search score.
http://docs.mongodb.org/manual/reference/operator/query/text/
http://docs.mongodb.org/manual/reference/operator/projection/meta/
It's also hard to say if the Criteria sort method will work properly without being able to test passing along the projection argument.