Filter_proc does not work as expected

Hi there

Since some days I’m developing a fulltext-search for our Bugzilla
system. Initial development time was very short but now I’m working on
some details and it does not work as expected. Basically it’s two
different problems but most likely related to each other. Attached is a
complete script which illustrates these two problems. Here some
excerpts.

Problem 1:
According to the Ferret API documentation it’s valid to scale the score
of results in a filter_proc like this:
filter_proc = lambda do |doc_id, score, searcher|
age = searcher[doc_id][:age].to_i
1.0/age
end
The filter_proc gets executed but the scale returned is just ignored by
ferret. Why is this?

Problem 2:
Why does this search return “0.0” as score for all docs?
docs = index.search("+matching +age:2", :filter_proc => simple_proc)
If I remove the filter_proc or the “+” before the age it works. The
simple_proc just returns true for all input. Why do I loose the score
here?

For me it looks like this whole filter_proc stuff is not yet stable or
maybe I don’t use it as I should. Any ideas?

Thanks a lot,
Thomas

sorry, attachment got lost. Next try…

Thomas

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs