lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: Whitespace Analyzer not producing expected search results
Date Wed, 17 Nov 2004 16:30:48 GMT
On Nov 17, 2004, at 7:44 AM, wrote:
> I then try a search using the term
> ResponseHelper.writeNoCachingHeaders\(*\);
> now I'm expecting this to be a wider search term and it should find at
> least two, possibly more docs?
> the query parser produces the query
> +contents:responsehelper.writenocachingheaders(*);
> wow the query has lost its case and no docs get returned.
> Why does the query parser do this (my analyzer is the provided 
> whitespace
> one).
> Any ideas to get around this ?

Because generally terms are lowercased when indexed by the analyzer 
(but not in your case with WhitespaceAnalyzer), QueryParser defaults to 
lowercasing wildcarded queries.  Wildcard query terms are not analyzed.

To get around this, construct an instance of QueryParser and turn the 
lowercasing of wildcard terms off:

     QueryParser parser = new QueryParser("field", new 

Use the instance of QueryParser instead of the static parse method from 
now on.


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

View raw message