Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Lucene: Java-User

update field boost

 

 

Lucene java-user RSS feed   Index | Next | Previous | View Threaded


yu at AI

Feb 11, 2008, 1:50 PM

Post #1 of 8 (1405 views)
Permalink
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 [at] lucene
For additional commands, e-mail: java-user-help [at] lucene


hossman_lucene at fucit

Feb 11, 2008, 8:54 PM

Post #2 of 8 (1353 views)
Permalink
Re: update field boost [In reply to]

: 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 [at] lucene
For additional commands, e-mail: java-user-help [at] lucene


yu at AI

Feb 11, 2008, 9:18 PM

Post #3 of 8 (1355 views)
Permalink
Re: update field boost [In reply to]

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 [at] lucene
> For additional commands, e-mail: java-user-help [at] lucene
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene


hossman_lucene at fucit

Feb 11, 2008, 9:34 PM

Post #4 of 8 (1354 views)
Permalink
Re: update field boost [In reply to]

: 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 [at] lucene
For additional commands, e-mail: java-user-help [at] lucene


yu at AI

Feb 12, 2008, 8:39 AM

Post #5 of 8 (1352 views)
Permalink
Re: update field boost [In reply to]

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 [at] lucene
> For additional commands, e-mail: java-user-help [at] lucene

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene


yu at AI

Feb 12, 2008, 9:51 AM

Post #6 of 8 (1354 views)
Permalink
Re: update field boost [In reply to]

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 [at] lucene
> For additional commands, e-mail: java-user-help [at] lucene

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene


hossman_lucene at fucit

Feb 12, 2008, 11:14 AM

Post #7 of 8 (1349 views)
Permalink
Re: update field boost [In reply to]

: 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 [at] lucene
For additional commands, e-mail: java-user-help [at] lucene


yu at AI

Feb 12, 2008, 1:32 PM

Post #8 of 8 (1351 views)
Permalink
Re: update field boost [In reply to]

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 [at] lucene
> For additional commands, e-mail: java-user-help [at] lucene

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene

Lucene java-user RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.