update field boost

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

update field boost

Jay-98
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: update field boost

hossman

: 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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: update field boost

Jay-98
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: [hidden email]
> For additional commands, e-mail: [hidden email]
>  

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: update field boost

hossman

: 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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: update field boost

Jay-98
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: [hidden email]
> For additional commands, e-mail: [hidden email]

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: update field boost

Jay-98
In reply to this post by hossman
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: [hidden email]
> For additional commands, e-mail: [hidden email]

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: update field boost

hossman

: 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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: update field boost

Jay-98
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: [hidden email]
> For additional commands, e-mail: [hidden email]

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]