Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-3640

Support MongoDB text search

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 5.1.0, origin-2.2.0
    • 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.

            Assignee:
            emily.stolfo Emily Stolfo
            Reporter:
            sbelous sbelous
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: