Boosting one copyField contributor

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Boosting one copyField contributor

kkrugler
Hi all,

When creating a combo field for searching, is there any
straight-forward way to boost the contribution of one of the fields
being used to create the combined field?

I'd read the past threads about this, and there didn't seem to be
anything built in to Solr.

A simple hack I did was to copy the field multiple times - e.g. have:

    <copyField source="field-to-boost" dest="combo-field"/>
    <copyField source="field-to-boost" dest="combo-field"/>
    <copyField source="field-to-boost" dest="combo-field"/>

in the schema, so that "field-to-boost" has an effective boost of 3x.
Since I don't do highlighting or display for this multi-value field,
that seems to work OK as long as this very course level of boosting
(2x, 3x, etc) was acceptable.

Is the above something that should continue to work in the future?
Are there issues with this approach that I haven't run into yet?

Thanks,

-- Ken
--
Ken Krugler
Krugle, Inc.
+1 530-210-6378
"Find Code, Find Answers"
Reply | Threaded
Open this post in threaded view
|

Re: Boosting one copyField contributor

Yonik Seeley-2
On 3/2/07, Ken Krugler <[hidden email]> wrote:

> Hi all,
>
> When creating a combo field for searching, is there any
> straight-forward way to boost the contribution of one of the fields
> being used to create the combined field?
>
> I'd read the past threads about this, and there didn't seem to be
> anything built in to Solr.
>
> A simple hack I did was to copy the field multiple times - e.g. have:
>
>     <copyField source="field-to-boost" dest="combo-field"/>
>     <copyField source="field-to-boost" dest="combo-field"/>
>     <copyField source="field-to-boost" dest="combo-field"/>
>
> in the schema, so that "field-to-boost" has an effective boost of 3x.

That's really the only way to do it.
Lucene boosts are per-field (not per-field-value) for a particular
document, so you can't have a multi-valued field with some values
boosted higher than others.

-Yonik
Reply | Threaded
Open this post in threaded view
|

Re: Boosting one copyField contributor

Walter Underwood, Netflix
I'm "denormalizing" into copyfields, one per boost level,
something like "text", "text_hi", and so on.

wunder

On 3/2/07 3:01 PM, "Yonik Seeley" <[hidden email]> wrote:

> On 3/2/07, Ken Krugler <[hidden email]> wrote:
>> Hi all,
>>
>> When creating a combo field for searching, is there any
>> straight-forward way to boost the contribution of one of the fields
>> being used to create the combined field?
>>
>> I'd read the past threads about this, and there didn't seem to be
>> anything built in to Solr.
>>
>> A simple hack I did was to copy the field multiple times - e.g. have:
>>
>>     <copyField source="field-to-boost" dest="combo-field"/>
>>     <copyField source="field-to-boost" dest="combo-field"/>
>>     <copyField source="field-to-boost" dest="combo-field"/>
>>
>> in the schema, so that "field-to-boost" has an effective boost of 3x.
>
> That's really the only way to do it.
> Lucene boosts are per-field (not per-field-value) for a particular
> document, so you can't have a multi-valued field with some values
> boosted higher than others.
>
> -Yonik

Reply | Threaded
Open this post in threaded view
|

Re: Boosting one copyField contributor

Chris Hostetter-3
In reply to this post by Yonik Seeley-2

: Lucene boosts are per-field (not per-field-value) for a particular
: document, so you can't have a multi-valued field with some values
: boosted higher than others.

this little bit of subtlety in Lucene terminology has always bugged me ...
the way i like to think of it is that field boosts are per field *name*
not per instnace of "Field" (or in solr's case: "...not per instance of
<field>")


-Hoss