lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ejblom <>
Subject LUCENE_35 index keyword analyzer only doesn't like indexed sentences
Date Mon, 16 Jan 2012 15:30:25 GMT

Dear Lucene-developers,

I switched to using Lucene 3.5 a few weeks ago and suddenly sentences are
not correctly indexed anymore. Basically, fields can be correctly queried if
they contain one term but if there are multiple terms, the analyzer fails (i
use the latest Luke for testing).

So my query is: contains:foo

it works on a document with field
but fails on
contains:ba foo

For indexing, this is how I start the writer

KeywordAnalyzer analyzer = new KeywordAnalyzer();
Directory index =;
IndexWriterConfig config = new IndexWriterConfig(Version.LUCENE_35,

IndexWriter writer = null;

        try {
            writer = new IndexWriter(index, config);
       } catch (IOException ex) {

And the particular field is index like this:

doc.add(new Field("contains", text.toLowerCase(), Field.Store.YES,

Pretty rivial right? 

Worked fine for my old (2.9) index but fails for 3.5... am I missing a very
important setting?

Thanks in advance!

EJ Blom

View this message in context:
Sent from the Lucene - Java Users mailing list archive at

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

View raw message