lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cam Bazz <>
Subject Keyword analyzer will turn query to lowercase
Date Thu, 22 Sep 2016 14:01:48 GMT

I am indexing userAgent fields found in apache logs. Indexing and querying
everything with
KeywordAnalyzer - But I found something strange:

            IndexSearcher searcher = new IndexSearcher(reader);
            Analyzer q_analyzer = new KeywordAnalyzer();
            QueryParser parser = new QueryParser("userAgent", q_analyzer);

            Query query = parser.parse(queryStr);

When searched for userAgent:Moz* the above code will output:

Info:   userAgent:Mo*
Info:   userAgent:mo*

The keyword analyzer is clearly turning the query string into lower case.

Is there a way to avoid it? The index is case sensitive (it wont any
documents staring with mo*)
but the keyword analyzer turns everything into lower case.

Best Regards,

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message