search for: append_to_query

Displaying 1 result from an estimated 1 matches for "append_to_query".

2007 May 09
6
more_like_this
...like to use more_like_this to retrieve some ''similar'' item suggestions. I have a class ''items'' which has a status field and I need to retrieve items that only have one of the two possible statuses. Looking at the more_like_this method indicates it supports an :append_to_query option that allows you to specify a proc that will modify the query object before the query is ''run''. This would seem to allow me to specify extra conditions to the query (such as +status:live). Item.more_like_this(:field_names => [:title, :description, :status], :append_to_q...