lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ismail Siddiqui" <ism...@gmail.com>
Subject problem deleting documents
Date Sun, 15 Oct 2006 05:59:09 GMT
hi guys
i am having problem deleting documents .. apparently its not doin it.. here
is the code snippet

     public void delete(final BoardMessage message)
     {
        try{

           IndexReader fsReader;

           if  (index.exists()) {
              fsReader  =IndexReader.open(index);
              fsReader.deleteDocuments(new Term("pk",message.getId()+""));
              fsReader.close();
           }

        }
        catch(IOException e){
         e.printStackTrace();
        }

now pk is primary key which i am storing but not indexing it..
     doc.add(new Field("pk", message.getId().toString(),Field.Store.YES,
                    Field.Index.NO));

when i am making a search i can get pk and show it in result...but above
code is not deleting the document

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