I’m using acts_as_ferret in my rails application and I’d 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
Item.more_like_this(:field_names => [:title, :description, :status],
:append_to_query => Proc … )
It’s a little unclear exactly what the query object is and there seem to
be no examples I can find outlining how to use this functionality, does
anybody have an example they could contribute ?