You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Jay <yu...@AI.SRI.COM> on 2008/02/11 22:50:07 UTC

update field boost

Hi,

It's clear that there is no easy way to do "in-place" doc update in the 
lucene index, but I think it should be theoretically possible to update 
the field and doc boostings in place, that is, without deleting and 
re-adding the doc and it's fields. Does anyone know how?

Thanks!

Jay

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: update field boost

Posted by Jay <yu...@AI.SRI.COM>.
It'd be helpful if there is an api for getting the norm of a given field 
in a given doc.
Thanks for the pointers.

Jay

Chris Hostetter wrote:
> : I read the doc for the api indexreader.setNorm() after I posted the question
> : earlier. To use that setNorm() to modify the field boost, it seems to me that
> : one has to know how the boost is folded to the norm (in the default impl, it's
> : boost* lengthNorm) and has to know the old norm value which is impossible to
> : get without getting all the norms for all the docs. Am I missing other apis to
> : use?
> 
> you might wnat to take a look at FieldNormModifier ... it doesn't deal 
> with boosts, but it shows how you can figure out the length part of the
> norm.
> 
> what you are attempting is definitly non trivial, computing a norm is a 
> one way function of several inputs -- you can't recompute a new norm by 
> changing only one of the inputs, you have to know what all of the other 
> orriginal inputs were.
> 
> 
> 
> -Hoss
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: update field boost

Posted by Jay <yu...@AI.SRI.COM>.
My bad. Thanks for the link!

Jay

Chris Hostetter wrote:
> : Do you know why FieldNormModifier is removed from Lucene 2.3?
> : thanks.
> 
> it wasn't...
> 
> http://lucene.apache.org/java/2_3_0/api/contrib-misc/org/apache/lucene/index/FieldNormModifier.html
> 
> ...it's in the "miscellaneous" contrib though so you'll need to use that 
> jar explicitly.
> 
> 
> 
> 
> -Hoss
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: update field boost

Posted by Chris Hostetter <ho...@fucit.org>.
: Do you know why FieldNormModifier is removed from Lucene 2.3?
: thanks.

it wasn't...

http://lucene.apache.org/java/2_3_0/api/contrib-misc/org/apache/lucene/index/FieldNormModifier.html

...it's in the "miscellaneous" contrib though so you'll need to use that 
jar explicitly.




-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: update field boost

Posted by Jay <yu...@AI.SRI.COM>.
Do you know why FieldNormModifier is removed from Lucene 2.3?
thanks.

Jay

Chris Hostetter wrote:
> : I read the doc for the api indexreader.setNorm() after I posted the question
> : earlier. To use that setNorm() to modify the field boost, it seems to me that
> : one has to know how the boost is folded to the norm (in the default impl, it's
> : boost* lengthNorm) and has to know the old norm value which is impossible to
> : get without getting all the norms for all the docs. Am I missing other apis to
> : use?
> 
> you might wnat to take a look at FieldNormModifier ... it doesn't deal 
> with boosts, but it shows how you can figure out the length part of the
> norm.
> 
> what you are attempting is definitly non trivial, computing a norm is a 
> one way function of several inputs -- you can't recompute a new norm by 
> changing only one of the inputs, you have to know what all of the other 
> orriginal inputs were.
> 
> 
> 
> -Hoss
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: update field boost

Posted by Chris Hostetter <ho...@fucit.org>.
: I read the doc for the api indexreader.setNorm() after I posted the question
: earlier. To use that setNorm() to modify the field boost, it seems to me that
: one has to know how the boost is folded to the norm (in the default impl, it's
: boost* lengthNorm) and has to know the old norm value which is impossible to
: get without getting all the norms for all the docs. Am I missing other apis to
: use?

you might wnat to take a look at FieldNormModifier ... it doesn't deal 
with boosts, but it shows how you can figure out the length part of the
norm.

what you are attempting is definitly non trivial, computing a norm is a 
one way function of several inputs -- you can't recompute a new norm by 
changing only one of the inputs, you have to know what all of the other 
orriginal inputs were.



-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: update field boost

Posted by yu <yu...@AI.SRI.COM>.
thanks, Hoss!
I read the doc for the api indexreader.setNorm() after I posted the 
question earlier. To use that setNorm() to modify the field boost, it 
seems to me that one has to know how the boost is folded to the norm (in 
the default impl, it's boost* lengthNorm) and has to know the old norm 
value which is impossible to get without getting all the norms for all 
the docs. Am I missing other apis to use?

Jay

Chris Hostetter wrote:
> : It's clear that there is no easy way to do "in-place" doc update in the lucene
> : index, but I think it should be theoretically possible to update the field and
> : doc boostings in place, that is, without deleting and re-adding the doc and
> : it's fields. Does anyone know how?
>
> boosts are folded into the norm, which is mutable using 
> IndexReader.setNorm
>
>
>
> -Hoss
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>   

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: update field boost

Posted by Chris Hostetter <ho...@fucit.org>.
: It's clear that there is no easy way to do "in-place" doc update in the lucene
: index, but I think it should be theoretically possible to update the field and
: doc boostings in place, that is, without deleting and re-adding the doc and
: it's fields. Does anyone know how?

boosts are folded into the norm, which is mutable using 
IndexReader.setNorm



-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org