Re: more on isDeleted

2008-09-15 Thread Michael McCandless
Sorry, I was talking about the future (when we can get realtime search working with Lucene). You have to change your code below to open a new reader (or reopen the reader from your IndexSearcher) call isDeleted on the new reader, to see the deletion you did with the writer. Or, you have

Re: more on isDeleted

2008-09-15 Thread Cam Bazz
Well, Document da = new Document(); da.add(new Field("word", "a", Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS)); writer.addDocument(da); writer.commit(); searcher = new IndexSearcher(dir); IndexReader reader = searcher.getIndexReader();

Re: more on isDeleted

2008-09-15 Thread Michael McCandless
It will return true if the provided docID was deleted, by term or query or docID (due to exception, privately) prior to when you asked IndexWriter to give you a "realtime" IndexReader. Mike Cam Bazz wrote: ok. but then under what circumstances isDeleted() will return true? Best. On Mon

Re: more on isDeleted

2008-09-15 Thread Cam Bazz
ok. but then under what circumstances isDeleted() will return true? Best. On Mon, Sep 15, 2008 at 10:57 PM, Michael McCandless <[EMAIL PROTECTED]> wrote: > > Until we can get realtime search integrated into Lucene (which I'm gradually > trying to working on) I think the answer is no -- for now yo

Re: more on isDeleted

2008-09-15 Thread Michael McCandless
Until we can get realtime search integrated into Lucene (which I'm gradually trying to working on) I think the answer is no -- for now you have to keep your own record of which docIDs you've deleted. Because IndexWriter allows deletes by query and term (and also by docID, privately, when

Re: more on isDeleted

2008-09-15 Thread Cam Bazz
So, apart from the searcher, is there anyway to access the deletion marks in an indexWriter. I have a live cache - and I was keeping two caches, ones for new adds, other for deletes. I am trying to get rid of deleted cache, and ask the index if a fetched document is marked deleted. Best. -C.B.

Re: more on isDeleted

2008-09-15 Thread Michael McCandless
You'll have to open a new IndexReader after the delete is committed. An IndexReader (or IndexSearcher) only searches the point-in-time snapshot of the index as of when it was opened. Mike Cam Bazz wrote: Hello, Here is what I am trying to do: dir = FSDirectory.getDirectory("/test