lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: Field Boosting
Date Thu, 17 Nov 2005 14:35:02 GMT

On 17 Nov 2005, at 09:23, dblanch@telemadrid.es wrote:
> I have a similar problem, I have boosted documents in an index,  
> when I run
> a query it shows boosted documents first, but when I loop the  
> Documents
> through the Hits class, this is:
>
> Document doc = hits.doc(i);
> System.out.println("Query scoring: "
>    + formatter.format(hits.score(i))); //never higher than 1.0. Is  
> this OK?

Scores are never higher than 1.0 from Hits.  If the top scoring  
document exceeds 1.0 in raw score, it gets normalized to 1.0 and all  
scores following get adjusted using that ratio.

> System.out.println("Document boost : "
>    + formatter.format(doc.getBoost())); //always shows 1.0 though
>                                         //it ranges from 2.0 to 1.0
>
> doc.getBoost() always shows 1.0 ┬┐Is it how it is supossed to be?

I don't believe, though haven't checked, that doc.getBoost() is a  
valid thing to call on documents retrieved from an index.  The boost  
factor gets collapsed into other factors computed at index time, so  
it is incorrect to expect the exact boost factor set at indexing time  
is available during searching.  Look at the Explanation (from  
IndexSearcher.explain) to see the factors used in scoring.

     Erik


>
> Regards,
>
> Daniel
>
> -----Erik Hatcher <erik@ehatchersolutions.com> escribi├│: -----
>
>
> Para: java-user@lucene.apache.org
> De: Erik Hatcher <erik@ehatchersolutions.com>
> Fecha: 17/11/2005 14:46
> Asunto: Re: Field Boosting
>
> Daniel,
>
> Could you give us a test case that shows the boost not working  
> properly?
>
> I'm using document level boosting (which is really what field level
> boosting does under the covers) in some of my applications and it is
> working as expected.
>
>     Erik
>
>
> On 17 Nov 2005, at 05:39, Daniel.Clark@sybase.com wrote:
>
>
>>
>> When I boost fields while indexing, the fields still have a boost
>> of 1.0
>> during searching.  When I view the values via Luke, it confirms the
>> value
>> of 1.0.  Do I have to boost it agin during search?  I want certain
>> fields
>> to have higher priority/score during search.  How do I get it to
>> work?  I'm
>> using version 1.4.3.  Any help will be appreciated.
>>
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> Daniel Clark, Senior Consultant
>> Sybase Federal Professional Services
>> 6550 Rock Spring Drive, Suite 800
>> Bethesda, MD  20817
>> Office - (301) 896-1103
>> Office Fax - (301) 896-1604
>> Mobile - (703) 403-0340
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>
> ---------------------------------------------------------------------
> 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


Mime
View raw message