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: TermQuery doesn't support non-english charecters
Date Mon, 10 Jul 2006 13:56:33 GMT

On Jul 9, 2006, at 8:29 AM, dan2000 wrote:

>
> yes, myField is a tokenized field. I've used ChineseAnalyzer. here  
> is an
> examle text ??
>
> Let me explain what exactly what I want.
>
> myField is a tokenized field:
> new Field("key",key, Field.Store.YES, Field.Index.TOKENIZED)
>
> I sometimes need to find the exact match. What would be the best  
> way to find
> a exact match for a tokenized field? I've tried:
> Query query = new QueryParser(myField,
> myLanguageAnalyzer).parse(myField+":"+myKey);
> mySearcher.search(query);
>
> But I always get a lot of relevant results with above code. The
> myLanguageAnalyzer is the same analyzer that was used for  
> indexing.  I just
> want something like "key = myKey" instead of " key like myKey".

I recommend you index the data into two separate fields, one  
tokenized, and one untokenized.  And vary which field you use  
depending on whether you want = or LIKE.

	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