lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dinh <pcd...@gmail.com>
Subject deleteDocuments() does not work
Date Wed, 28 Oct 2009 10:45:04 GMT
Hi all,

I have a very simple method to delete a document that is indexed before

    /**
     * @param id
     */
    public void deleteById(String id) throws IOException {
        IndexWriter writer = IndexWriterFactory.factory();

        try {
            writer.deleteDocuments(new Term(Configuration.Field.ID,
String.valueOf(id)));
            writer.commit();
        } catch (ArrayIndexOutOfBoundsException e) {
            // CHECK ignore this. Can happen if index has not been built yet
        } catch (IOException e) {
            System.out.println(e);
        }
    }

The problem is after executing this method without any exception, I come
back and try to do a search the supposed-to-be-deleted record is still
there. I need to restart my servlet engine to have that record been really
deleted. How can it happen?

Thanks

Dinh

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