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


hossman_lucene at fucit

Feb 11, 2008, 8:54 PM

Post #2 of 8 (723 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.apache.org
For additional commands, e-mail: java-user-help[at]lucene.apache.org


yu at AI

Feb 11, 2008, 9:18 PM

Post #3 of 8 (720 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.apache.org
> For additional commands, e-mail: java-user-help[at]lucene.apache.org
>

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


hossman_lucene at fucit

Feb 11, 2008, 9:34 PM

Post #4 of 8 (724 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.apache.org
For additional commands, e-mail: java-user-help[at]lucene.apache.org


yu at AI

Feb 12, 2008, 8:39 AM

Post #5 of 8 (717 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.apache.org
> For additional commands, e-mail: java-user-help[at]lucene.apache.org

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


yu at AI

Feb 12, 2008, 9:51 AM

Post #6 of 8 (716 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.apache.org
> For additional commands, e-mail: java-user-help[at]lucene.apache.org

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


hossman_lucene at fucit

Feb 12, 2008, 11:14 AM

Post #7 of 8 (719 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.apache.org
For additional commands, e-mail: java-user-help[at]lucene.apache.org


yu at AI

Feb 12, 2008, 1:32 PM

Post #8 of 8 (721 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.apache.org
> For additional commands, e-mail: java-user-help[at]lucene.apache.org

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

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


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.