Hi Everyone,
I’m using Ferret 0.10.11 with acts_as_ferret from SVN (same results with
0.10.10 and 0.10.9 though).
I’m running into an odd problem where the scores of my top-ranking
search results are ridiculously small - even when the query is one that
should match at least one document with a decent score.
To give an example, I have just the names of 5 businesses indexed using
the standard analyzer. (The same happens with thousands of records
indexed by many fields but I’ve simplified for this example). One of
those businesses is called “ABC Master Building Designers”. When I do a
query for “building” I get “ABC Master Building Designers” as the top
result, but with the following explanation (via code a added to
acts_as_ferret for debugging):
QUERY: id:building name:building
EXPLANATION of building: 8.438619e-42 = product of:
1.687724e-41 = weight(name:building in 3), product of:
0.6125279 = query_weight(name:building), product of:
2.386294 = idf(doc_freq=1)
0.2566858 = query_norm
2.755373e-41 = field_weight(name:building in 3), product of:
1.0 = tf(term_freq(name:building)=1)
2.386294 = idf(doc_freq=1)
1.15467e-41 = field_norm(field=name, doc=3)
0.5 = coord(1/2)
Note the tiny score of field_norm which is throwing the whole score out.
The net result is that all the records aren’t differenciated by much and
so the ordering of the results rarely makes much sense. I sometimes get
restaurants in the search results!
I haven’t used any boost or anything on the name field. My Business
class calls AaF like this:
class Business < ActiveRecord::Base
acts_as_ferret(
:fields => { :name => { } },
:or_default => true
)
…
end
Does anyone have any ideas as to what might be causeing this? Any help
would be greatly appreciated.
Thanks,
Pete.