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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]