Forum: Ferret filter_proc problem with limit

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
0377ec6fab3880beb5da3dde78af5418?d=identicon&s=25 Henrik Zagerholm (cubiq)
on 2008-07-01 14:43
(Received via mailing list)
Hi list,

I have a problem grouping with ferret.

I'm using the filter_proc from Dave's book as seen below

results = {}
group_by_proc = lambda do |doc_id, score, searcher|
  doc = searcher[doc_id]
    (results[doc[:pk_file_id]]||=[]) << doc[:filename] << doc[:path]
  next true

The problem is that if I use this it ignores my limit clause.

I set limit on 10 and I still get 5995 results and it takes several

How come the limit clause is ignored when using a filter_proc? How can
I change this behaviour?

term = "wi"

bool1 =
bool1.add_query(, "#{term}"))
bool1.add_query(, "#{term}")), :limit => 10, :filter_proc => group_by_proc)

puts result.size

0377ec6fab3880beb5da3dde78af5418?d=identicon&s=25 Henrik Zagerholm (cubiq)
on 2008-07-04 11:58
(Received via mailing list)
Has anyone tried this?

I'm I the only one trying to group results from ferret?


1 jul 2008 kl. 14.43 skrev Henrik:
This topic is locked and can not be replied to.