lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: literal search in quotes on non-tokenized field
Date Wed, 01 Dec 2004 00:14:38 GMT

On Nov 30, 2004, at 6:01 PM, Allen Atamer wrote:
>> It doesn't work that way.  A TermQuery must match *exactly* what was
>> indexed (either directly as a Keyword, or as tokens emitted from the
>> analyzer).  Since you're building the query up yourself from, I'm
>> assuming, user input, you may need to pre-process what the user 
>> entered
>> to get the right term to query on.  Only the term origi would match.
> Yeah but it doesn't. The exact text in the database is ORIGI.

But you lowercased what you indexed (in the code you sent).

>  Keyword
> doesn't work if you supply more than one word.

Depends on what you mean by "doesn't work".  It works as expected. 
Keyword fields are not tokenized and thus a TermQuery on it has to be 
exactly the value you supplied.  But it sounds like you've got a handle 
on the situation now.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message