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

	Erik


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


Mime
View raw message