lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven Rowe <>
Subject Re: Problem searching Field.Keyword field
Date Tue, 08 Feb 2005 17:19:19 GMT
Why is there no KeywordAnalyzer?  That is, an analyzer which doesn't 
mess with its input in any way, but just returns it as-is?

I realize that under most circumstances, it would probably be more code 
to use it than just constructing a TermQuery, but having it would 
regularize query handling, and simplify new users' experience.  And for 
the purposes of the PerFieldAnalyzerWrapper, it could be helpful.


Erik Hatcher wrote:
> Kelvin - I respectfully disagree - could you elaborate on why this is 
> not an appropriate use of Field.Keyword?
> If the category is "How To", Field.Text would split this (depending on 
> the Analyzer) into "how" and "to".
> If the user is selecting a category from a drop-down, though, you 
> shouldn't be using QueryParser on it, but instead aggregating a 
> TermQuery("category", "How To") into a BooleanQuery with the rest of 
> it.  The rest may be other API created clauses and likely a piece from 
> QueryParser.
>     Erik
> On Feb 8, 2005, at 11:28 AM, Kelvin Tan wrote:
>> As I posted previously, Field.Keyword is appropriate in only certain 
>> situations. For your use-case, I believe Field.Text is more suitable.
>> k
>> On Tue, 8 Feb 2005 10:02:19 -0600, Mike Miller wrote:
>>>  This may or may not be correct, but I am indexing it as a keyword
>>>  because I provide a (required) radio button on the add screen for
>>>  the user to determine which category the document should be
>>>  assigned.  Then in the search, provide a dropdown that can be used
>>>  in the advanced search so that they can search only for a specific
>>>  category of documents (like HowTo, Troubleshooting, etc).
>>>  -----Original Message-----
>>>  From: Kelvin Tan [] Sent: Tuesday,
>>>  February 08, 2005 9:32 AM To: Lucene Users List
>>>  Subject: RE: Problem searching Field.Keyword field
>>>  Mike, is there a reason why you're indexing "category" as keyword
>>>  not text?
>>>  k
>>>  On Tue, 8 Feb 2005 08:26:13 -0600, Mike Miller wrote:
>>>>  Thanks for the quick response.
>>>>  Sorry for my lack of understanding, but I am learning!  Won't the
>>>>   query parser still handle this query?  My limited understanding
>>>>  was  that the search call provides the 'all' field as default
>>>>  field for  query terms in the case where fields aren't specified.
>>>>    Using the  current code, searches like author:Mike" and
>>>>  title:Lucene work fine.
>>>>  -----Original Message-----
>>>>  From: Miles Barr [] Sent:  
>>>>  Tuesday, February 08, 2005 8:08 AM To: Lucene Users List Subject:
>>>>   Re: Problem searching Field.Keyword field
>>>>  You're using the query parser with the standard analyser. You  
>>>>  should construct a term query manually instead.
>>>>  --
>>>>  Miles Barr <> Runtime Collective Ltd.

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

View raw message