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 John Patterson <de...@hotmail.com> on 2004/07/21 16:06:57 UTC

Weighting database fields

Hi,

What is the best way to get Lucene to assign weightings to certain fields
from a database?  For example, the 'name' field should be weighted higher
than the 'description' field.

Thanks,

John.

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


Re: Weighting database fields

Posted by John Patterson <de...@hotmail.com>.
Thanks, that was what I was after!

----- Original Message ----- 
From: "Erik Hatcher" <er...@ehatchersolutions.com>
To: "Lucene Users List" <lu...@jakarta.apache.org>
Sent: Wednesday, July 21, 2004 9:52 PM
Subject: Re: Weighting database fields


> On Jul 21, 2004, at 10:09 AM, Anson Lau wrote:
> > Apply boost factor to fields when you do a lucene search.
> 
> Or... set the boost on the Field during indexing.
> 
> Erik
> 
> 
> >
> > Anson
> >
> > -----Original Message-----
> > From: John Patterson [mailto:dev_johnpatterson@hotmail.com]
> > Sent: Thursday, July 22, 2004 12:07 AM
> > To: lucene-user@jakarta.apache.org
> > Subject: Weighting database fields
> >
> > Hi,
> >
> > What is the best way to get Lucene to assign weightings to certain 
> > fields
> > from a database?  For example, the 'name' field should be weighted 
> > higher
> > than the 'description' field.
> >
> > Thanks,
> >
> > John.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: lucene-user-help@jakarta.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: lucene-user-help@jakarta.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
> 
> 

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


Unnecesary scan with required terms

Posted by John Patterson <de...@hotmail.com>.
Hi,

I have been looking at how Lucene operates with queries where all terms are
required.  I expected that the algorithm would step through each term to
confirm that it did exist in the index and as soon as a clause is found that
does not occur, the search would be aborted.  As far as I can tell this does
not happen and the search continues on to find the frequencey of the other
terms even though no hits will be returned.

This occurs during the call to Query.weight() when the weightings are
calulated before terms are scored.

Is this correct?

Thanks,

John.

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


Re: Weighting database fields

Posted by Doug Cutting <cu...@apache.org>.
Ernesto De Santis wrote:
> If some field have set a boots value in index time, and when in search time
> the query have another boost value for this field, what happens?
> which value is used for boost?

The two boosts are both multiplied into the score.

Doug

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


Re: Weighting database fields

Posted by Ernesto De Santis <er...@colaborativa.net>.
Hi Erik

> On Jul 21, 2004, at 11:40 AM, Anson Lau wrote:
> > Is there any benefit to set the boost during indexing rather than set
> > it
> > during query?
>
> It allows setting each document differently.  For example,
> TheServerSide is using field-level boosts at index time to control
> ordering by date, such that newer articles come up first.  This could
> not be done at query time since each document gets a different field
> boost.

If some field have set a boots value in index time, and when in search time
the query have another boost value for this field, what happens?
which value is used for boost?

Bye,
Ernesto.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.725 / Virus Database: 480 - Release Date: 19/07/2004


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


Re: Weighting database fields

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Jul 21, 2004, at 11:40 AM, Anson Lau wrote:
> Is there any benefit to set the boost during indexing rather than set 
> it
> during query?

It allows setting each document differently.  For example, 
TheServerSide is using field-level boosts at index time to control 
ordering by date, such that newer articles come up first.  This could 
not be done at query time since each document gets a different field 
boost.

	Erik


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


RE: Weighting database fields

Posted by Anson Lau <al...@fulfil-net.com>.
Erik,

Is there any benefit to set the boost during indexing rather than set it
during query?

I usually set it when doing a query because you can change that boost values
easily without having to re-index.

Thanks,
ANson


-----Original Message-----
From: Erik Hatcher [mailto:erik@ehatchersolutions.com] 
Sent: Thursday, July 22, 2004 12:52 AM
To: Lucene Users List
Subject: Re: Weighting database fields

On Jul 21, 2004, at 10:09 AM, Anson Lau wrote:
> Apply boost factor to fields when you do a lucene search.

Or... set the boost on the Field during indexing.

	Erik


>
> Anson
>
> -----Original Message-----
> From: John Patterson [mailto:dev_johnpatterson@hotmail.com]
> Sent: Thursday, July 22, 2004 12:07 AM
> To: lucene-user@jakarta.apache.org
> Subject: Weighting database fields
>
> Hi,
>
> What is the best way to get Lucene to assign weightings to certain 
> fields
> from a database?  For example, the 'name' field should be weighted 
> higher
> than the 'description' field.
>
> Thanks,
>
> John.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org


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


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


Re: Weighting database fields

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Jul 21, 2004, at 10:09 AM, Anson Lau wrote:
> Apply boost factor to fields when you do a lucene search.

Or... set the boost on the Field during indexing.

	Erik


>
> Anson
>
> -----Original Message-----
> From: John Patterson [mailto:dev_johnpatterson@hotmail.com]
> Sent: Thursday, July 22, 2004 12:07 AM
> To: lucene-user@jakarta.apache.org
> Subject: Weighting database fields
>
> Hi,
>
> What is the best way to get Lucene to assign weightings to certain 
> fields
> from a database?  For example, the 'name' field should be weighted 
> higher
> than the 'description' field.
>
> Thanks,
>
> John.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org


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


RE: Weighting database fields

Posted by Anson Lau <al...@fulfil-net.com>.
Apply boost factor to fields when you do a lucene search.

Anson

-----Original Message-----
From: John Patterson [mailto:dev_johnpatterson@hotmail.com] 
Sent: Thursday, July 22, 2004 12:07 AM
To: lucene-user@jakarta.apache.org
Subject: Weighting database fields

Hi,

What is the best way to get Lucene to assign weightings to certain fields
from a database?  For example, the 'name' field should be weighted higher
than the 'description' field.

Thanks,

John.

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


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