Re: delete a document from indexwriter

2008-01-22 Thread Michael McCandless
Well, docIDs are used all over the place in the index. Sometimes they key into an index file "linearly", like for stored fields and term vectors index files, but other times they are encoded eg in the posting lists. Mike Cam Bazz wrote: Yes, I have found. however it is not for reqular

Re: delete a document from indexwriter

2008-01-22 Thread Michael McCandless
Exactly, that is the method... Mike Cam Bazz wrote: Hello, Did you mean the synchronized private void addDeleteDocID(int docId) { bufferedDeleteDocIDs.add(new Integer(docId)); numBytesUsed += OBJECT_HEADER_BYTES + BYTES_PER_INT + OBJECT_POINTER_BYTES; } this however does not

Re: delete a document from indexwriter

2008-01-22 Thread Michael McCandless
Cam Bazz wrote: Yes, I noticed http://www.archivum.info/[EMAIL PROTECTED]/2006-09/ msg00065.html Somehow I gotta do my delete within the same writer. I could use another field that combines both src and dst field, and use this field without storing but still a waste of resources. I wonde

Re: delete a document from indexwriter

2008-01-22 Thread Cam Bazz
I am looking at the IndexWriter source code - and I could not find a method (private) to delete by doc id. Where is it hiding? Best, -C.B. On Jan 19, 2008 1:07 PM, Michael McCandless <[EMAIL PROTECTED]> wrote: > > Good question > > So far, this method has not been carried over to IndexWriter

Re: delete a document from indexwriter

2008-01-21 Thread Cam Bazz
Yes, I noticed http://www.archivum.info/[EMAIL PROTECTED]/2006-09/msg00065.html Somehow I gotta do my delete within the same writer. I could use another field that combines both src and dst field, and use this field without storing but still a waste of resources. I wonder if IndexWriter can be mo

Re: delete a document from indexwriter

2008-01-21 Thread Michael McCandless
You will have to close the IndexWriter. Only one "writer" may be open at once on an index, where "writer" includes an IndexReader that has done some deletes (the first time you delete a document using a reader, it will acquire the write.lock, which will fail if you have another writer open

Re: delete a document from indexwriter

2008-01-21 Thread Cam Bazz
Hello Michael; how can I construct a chain where both reader and writer at the same state? You can call getIndexReader method of the IndexSearcher. But when I delete documents through the reader, how will this interact with the writer? I am have disabled autoflush and using my own logic to do flus

Re: delete a document from indexwriter

2008-01-21 Thread Michael McCandless
For this case, too, you will need to use an IndexReader, or use IndexSearcher to run that particular search and then delete the docIDs returned using the IndexReader. Though, be sure to first iterate through all hits, gathering all docIDs. And then in 2nd pass, do the deletions. Otherwi

Re: delete a document from indexwriter

2008-01-21 Thread Cam Bazz
Hello Mike; How about deleting by a compount term? for example if I have a document with two fields srcId and dstId and I want to delete the document where srcId=1 and dstId=2 right now there exists a IndexWriter.deleteDocuments(Term t) but with that I can only delete lets say where srcId=someth

Re: delete a document from indexwriter

2008-01-19 Thread Michael McCandless
Good question So far, this method has not been carried over to IndexWriter because in general it's not really safe, since there's no way to get an accurate docID from IndexWriter itself. You can't really "know" when IndexWriter does merges that compacts deletes and thus changes docID

delete a document from indexwriter

2008-01-18 Thread Cam Bazz
Hello, How do I delete a specific document from an indexwriter? I understand there is deleteDocuments(term) which deletes all the documents matching the term. But what if I want to delete a document that has more then one term in specific. I can search the document with a boolean query, and then g