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 Karthik N S <ka...@controlnet.co.in> on 2005/01/11 06:57:20 UTC

QUERYPARSIN & BOOSTING


Hi Guys



Apologies...........

This Question may be asked million times on this form ,need some
clarifications.

1) FieldType =  keyword      name =  vendor

2)FieldType =  text              name = contents

Question:

1) How to Construct a Query which would allow hits  avaliable for the VENDOR
to  appear  first ?.

2) If boosting is to be applied How TO   ?.

3) Is the Query Constructed Below correct?.

+Contents:shoes +((vendor:nike)^10)



Please Advise.
Thx in advance.


WITH WARM REGARDS
HAVE A NICE DAY
[ N.S.KARTHIK]



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


Re: QUERYPARSIN & BOOSTING

Posted by Nader Henein <ns...@bayt.net>.
 From the text on the Lucene Jakarta Site : 
http://jakarta.apache.org/lucene/docs/queryparsersyntax.html


Lucene provides the relevance level of matching documents based on the 
terms found. To boost a term use the caret, "^", symbol with a boost 
factor (a number) at the end of the term you are searching. The higher 
the boost factor, the more relevant the term will be.

    Boosting allows you to control the relevance of a document by
    boosting its term. For example, if you are searching for

    		
    	

jakarta apache

    	
    		

    and you want the term "jakarta" to be more relevant boost it using
    the ^ symbol along with the boost factor next to the term. You would
    type:

    		
    	

jakarta^4 apache

    	
    		

    This will make documents with the term jakarta appear more relevant.
    You can also boost Phrase Terms as in the example:

    		
    	

"jakarta apache"^4 "jakarta lucene"

    	
    		

    By default, the boost factor is 1. Although the boost factor must be
    positive, it can be less than 1 (e.g. 0.2)


Regards.

Nader Henein


Karthik N S wrote:

>Hi Guys
>
>
>
>Apologies...........
>
>This Question may be asked million times on this form ,need some
>clarifications.
>
>1) FieldType =  keyword      name =  vendor
>
>2)FieldType =  text              name = contents
>
>Question:
>
>1) How to Construct a Query which would allow hits  avaliable for the VENDOR
>to  appear  first ?.
>
>2) If boosting is to be applied How TO   ?.
>
>3) Is the Query Constructed Below correct?.
>
>+Contents:shoes +((vendor:nike)^10)
>
>
>
>Please Advise.
>Thx in advance.
>
>
>WITH WARM REGARDS
>HAVE A NICE DAY
>[ N.S.KARTHIK]
>
>
>
>---------------------------------------------------------------------
>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