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 StandardAnalyzer());
parser.setLowercaseWildcardTerms(false);
Use the instance of QueryParser instead of the static parse method from now on.
Erik
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]