Hey guys,
Simple question here.
I have a single index of recipes, from which I'm looking at the
following fields: Name, Ingredient Text, Tags, and Description.
The key is, I want to show all the results that come from Name,
before I show any of the results from Ingredient Text, Tags, or
Description.
I tried doing this:
acts_as_ferret :fields => {
:name => {:boost => 9000, :store => :yes},
:ingredients => {:boost => 6000, :store => :yes},
:tags => {:boost => 3000, :store => :yes},
:description => {:boost => 1, :store => :yes}}
I figured if I put huge boost on my fields, the "name" results would
always come before ingredients (no matter what the score).
Can anyone throw me any ideas on how one might do this? Here is an
explain of one of my first results. Perhaps I need to change the
rounding of my score? I dunno.
Basque chicken scored 1.0
3291.866 = product of:
6583.732 = sum of:
674.6201 = weight(ingredients_without_brackets:chicken in 12670),
product of:
0.2805449 = query_weight(ingredients_without_brackets:chicken),
product of:
3.13109 = idf(doc_freq=2145)
0.08959977 = query_norm
2404.677 = field_weight(ingredients_without_brackets:chicken in
12670), product of:
1.0 = tf(term_freq(ingredients_without_brackets:chicken)=1)
3.13109 = idf(doc_freq=2145)
768.0 = field_norm(field=ingredients_without_brackets,
doc=12670)
5909.112 = weight(tags_with_spaces:chicken in 12670), product of:
0.4547729 = query_weight(tags_with_spaces:chicken), product of:
5.075603 = idf(doc_freq=306)
0.08959977 = query_norm
12993.54 = field_weight(tags_with_spaces:chicken in 12670),
product of:
1.0 = tf(term_freq(tags_with_spaces:chicken)=1)
5.075603 = idf(doc_freq=306)
2560.0 = field_norm(field=tags_with_spaces, doc=12670)
0.5 = coord(2/4)
Thanks in advance,
-Gregg