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: Problem searching Field.Keyword field
Date Tue, 08 Feb 2005 14:45:41 GMT
The problem is that QueryParser analyzes all pieces of a query 
expression regardless of whether you indexed them as a Field.Keyword or 
not.  If you need to use QueryParser and still support keyword fields, 
you'll want to plug in an analyzer specific to that field using 
PerFieldAnalyzerWrapper.  You'll see this demonstrated in the "Lucene 
in Action" source code.  Here's a quick pointer to where we cover it in 
the book:

	http://www.lucenebook.com/search?query=KeywordAnalyzer


On Feb 8, 2005, at 9:26 AM, 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 [mailto:miles@runtime-collective.com]
> 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 <miles@runtime-collective.com> Runtime Collective Ltd.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org


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