removing a field from the relevance calculation

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

removing a field from the relevance calculation

Bart Smyth
Hi,

I'm having trouble getting a field of type SortableFloatField to not
weigh into to the relevancy score returned for a document.

<fieldtype name="sfloat" class="solr.SortableFloatField"
sortMissingLast="true" omitNorms="true"/>

So far I've tried boosting the field to 0.0 at index time using this
field type - and also implemented a custom Similarity implementation
that overrode lengthNorm(String fieldname, int numTerms) after
converting the field to a text field.

Nothing I do seems to affect the behavior that when the value of the
field in question changes, the score of the document changes along with
it.  The field does need to be both indexed and stored.  There is a
requirement to be able to sort by that field, and it must be returned in
the document when searching.

Am I going about this the wrong way?

Regards,

Bart Smyth

 


IMPORTANT: This e-mail, including any attachments, may contain private or confidential information.
If you think you may not be the intended recipient, or if you have received this e-mail in error, please contact the sender immediately and delete all copies of this e-mail.
If you are not the intended recipient, you must not reproduce any part of this e-mail or disclose its contents to any other party.
This email represents the views of the individual sender, which do not necessarily reflect those of education.au limited except where the sender expressly states otherwise.
It is your responsibility to scan this email and any files transmitted with it for viruses or any other defects. education.au limited will not be liable for any loss, damage or consequence caused directly or indirectly by this email.

Reply | Threaded
Open this post in threaded view
|

Re: removing a field from the relevance calculation

Yonik Seeley-2
On 9/6/07, Bart Smyth <[hidden email]> wrote:

> I'm having trouble getting a field of type SortableFloatField to not
> weigh into to the relevancy score returned for a document.
>
> <fieldtype name="sfloat" class="solr.SortableFloatField"
> sortMissingLast="true" omitNorms="true"/>
>
> So far I've tried boosting the field to 0.0 at index time using this
> field type - and also implemented a custom Similarity implementation
> that overrode lengthNorm(String fieldname, int numTerms) after
> converting the field to a text field.
>
> Nothing I do seems to affect the behavior that when the value of the
> field in question changes, the score of the document changes along with
> it.

Perhaps it's a coincidence that when you change the value of that
field (presumably by re-indexing the document) that the relevancy
score changes.  The relevancy score can change somewhat because lucene
deleted documents are only marked for deletion until a segment merge
removes them, and the terms in that document still count in the idf
factor (inverse document frequency).   To test this theory, optimize
the index after you change the value each time.

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

Re: removing a field from the relevance calculation

hossman
In reply to this post by Bart Smyth

: I'm having trouble getting a field of type SortableFloatField to not
: weigh into to the relevancy score returned for a document.

unless you actually use the field in your query in some way it will not
factor into the score at all -- no matter what options you set on it or
the fieldtype.

you use add the debugQuery=true param to your queries and look at the
score explanation output for each doc that gets added to the very bottom
of your results, you'll see a lot of stuff that may not make much sense --
but unless your field name appears in there somewhere your field isn't
part of the score calculation.




-Hoss