lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Otis Gospodnetic <otis_gospodne...@yahoo.com>
Subject Re: Question about Boosting Fields in a Query
Date Wed, 27 Apr 2005 15:29:33 GMT
Hi Sven,

http://www.lucenebook.com/search?query=search+boost+field
(hm, I was hoping to find something better)

You can use setBoost at search time: Query class has setBoost(float)
method, which you can use if you construct queries in the code, and
QueryParser supports ^float syntax, which puts the power in the hands
of people entering queries.

Otis


--- Sven <sven@schmeier.de> wrote:
>  
>  
> Hi folks,
>  
> I have a question about boosting fields in a Query.
> Suppose we have documents like this in the index:
>  
> fieldA:String fieldB:String fieldC:Date fieldD:Number
>  
> And the query is like that:
>  
> fieldA: wordA1 wordA2 wordA3 wordA4  
> fieldB: wordB1 wordB2 wordB3 wordB4
> fieldC:[date1 to date2]
> fieldD:[number1 to number2]
>  
>  
> Now what I want to do is to boost certain fields, for example the
> fieldA
> of the query should be boosted by a factor of 2.
> What is the most elegant way to do that?
>  
> btw. boosting document fields doesnt help as different users should
> be
> able to boost different fields....
>  
>  
> Thanks,
> Sven
> 

---------------------------------------------------------------------
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