Jens Kraemer wrote:
> that of course works if :area_id is an indexed field.
>
> If area_id is not indexed, the :conditions option can be used to limit
> the find call that retrieves the model instances via ActiveRecord. Note
> that you might get less results than expected when using :conditions,
> since AR filters records out that Ferret counted as a hit.
>
> correct usage:
>
> @results = SupplierProduct.find_by_contents(params[:search], {}, {
> :conditions => [] })
>
> the first hash is for ferret-related options (like :limit, :offset and
> so on), the second for activeRecord options.
>
Hi Jens and thanks for the help but I seem to be getting an error when I
use the following -
@results = MarketingProduct.find_by_contents(search_text, {},
:conditions => 'live = "t"')
I'm getting this error -
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occured while evaluating nil.sort!
#{RAILS_ROOT}/vendor/plugins/acts_as_ferret/lib/acts_as_ferret.rb:286:in
`find_by_contents'
#{RAILS_ROOT}/app/controllers/marketing_controller.rb:21:in `results'
Any ideas what might be up?
Thanks,
Alastair
--
Posted via http://www.ruby-forum.com/.
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk