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: exact match ..
Date Mon, 20 Feb 2006 18:26:12 GMT

On Feb 20, 2006, at 1:02 PM, Mufaddal Khumri wrote:
> If I understand you right, I could use something like the Keyword  
> analyzer to tokenize the entire stream as a single token and store  
> that in the index. I could definitely the keyword analyzer while  
> indexing this particular field "categoryNames".

The KeywordAnalyzer is not needed for indexing... simply use  
Field.Keyword() for indexing without analysis.  Beware of case  
sensitivity though.

> +(+content:digit +content:camera) +entity:product +(title:"digit  
> camera"~2^40.0 ((title:digit title:camera)^10.0) content:"digit  
> camera"~2^20.0 (content:digit content:camera) categoryNames:"digit  
> camera"^80.0)
>
> As you can see i was trying to do a phrase query on the  
> categoryNames field and boosting it by 80.0.
> Also I am using the potter stemming filter to stem while searching.  
> (I do this while indexing as well). If I go with the  
> KeywordAnalyzer approach I can index the categoryNames field using  
> this analyzer .
>
> Would I be using the QueryParser to create my query and specify the  
> keyword analyzer to it while searching on categoryNames ? (and then  
> make that query part of my global boolean query?)

You can use the PerFieldAnalyzerWrapper with the KeywordAnalyzer  
assigned to your categoryNames field, sure, but you wouldn't have  
stemming capability at that point.

	Erik


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