What happens if you try without :star in your search options? Wildcards can
play havoc a little with relevance scores. Also, weights should be at least 1 -
that's the minimum/default value for every field you don't mention. And
finally, it's worth playing with your field weight values and seeing how that
influences the actual relevance scores.
http://freelancing-god.github.com/ts/en/common_issues.html#weights
Cheers
--
Pat
On 13/12/2011, at 11:00 PM, rejeep wrote:
> Hi,
>
> I have a model called SparePart I want to search. I defined this
> index:
>
> define_index do
> indexes :name_sv, :sortable => true
> indexes :name_en, :sortable => true
> indexes :article_number, :sortable => true
>
> set_property :enable_star => true
> set_property :min_prefix_len => 1
> end
>
> The user can choose to search on name or article number. If locale is
> sv, then name_sv is searched, otherwise name_en is. So at a single
> search, only one of the three attributes is used.
>
> Here is an example of options passed to #search when name_sv is be
> searched:
>
> options = {
> :limit => 100,
> :field_weights => {
> :name_sv => 100,
> :name_en => 0,
> :article_number => 0
> },
> :conditions => {
> :name_sv => "pump"
> }, :star => true
> }
>
> I use field_weights to set the other fields as irrelevant.
>
> The problem is that no matter what I set the field_weights to, the
> order is always the same. Here are the first records (column order:
> article_number, name_sv, name_en):
> 42727,31
> MOTORFÄSTE WD-4 FIR-PUMP
> PUMP BRACKET WD-4 FIR-PUMP
>
> 805,2611
> PUMPHUS PUMP 1225/1295
> PUMP HOUSING 1225/1295
>
> 03010,01
> PUMPSIL WD-6 MOD Ä
> PUMP STRAINER
>
> So, why is the order always the same? And why is "MOTORFÄSTE WD-4 FIR-
> PUMP" considered more relevant than "PUMPHUS PUMP 1225/1295". It makes
> no sense to me... Should be the other way around!
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Thinking Sphinx" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/thinking-sphinx?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"Thinking Sphinx" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/thinking-sphinx?hl=en.