On Tue, Aug 19, 2014 at 5:27 PM, Uwe Schindler <u...@thetaphi.de> wrote:
> Hi,
>
> You forgot to close (or commit) IndexWriter before opening the reader.

Huh? The code I posted is closing it:

                try (IndexWriter writer = new IndexWriter(directory,
new IndexWriterConfig(Version.LUCENE_36, analyser))) {
                    Document document = new Document();
                    document.add(new Field("content", "blah blah
commercial blah blah \u79CB\u8449\u539F blah blah", Field.Store.NO,
Field.Index.ANALYZED));
                    writer.addDocument(document);
                }  <-- closed here

And anyway, if it weren't being closed, how would you explain the
terms ending up in the index?

TX

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

Reply via email to