Hi Michael, On Tue, Jan 22, 2008, Michael Busch wrote about "Unique doc ids": > the question of how to delete with IndexWriter using doc ids is >... > mapping from the dynamic doc ids to the new unique ones. We would also > have to store a reverse mapping (UID -> ID) in the index - we could use > a VInt list + skip list for that. > Then we should be able to make IndexReaders "read-only" (LUCENE-1030) > and provide a new API in IndexWriter "delete by UID".
It sounds to me that this list would be split according to segments, right? In that case, whoever wants to read this list will need to behave like a IndexReader (which opens all segments), not an IndexWriter (which writes to only one segment). So it still makes some sort of twisted sense to have "delete by UID" in the indexReader (like delete document was originally). In any case, I'm afraid I don't understand how your proposal to add special "UIDs" differs from the existing situation, where you can put your UIDs in a certain field (e.g., call that field "UID" if you want) and then you can use IndexWriter.deleteDocuments(term) to delete documents (in your case, just one) with this term. How is your new suggestion better, or more efficient? > This would allow > to "delete by query" as well. Again, I don't understand how this makes a difference. In the existing Lucene, you can also theoretically run a query, get a list of docids, and then delete them all. I said "theoretically" because unfortunately, the current IndexWriter interface doesn't support the necessary calls (either a deleteDocuments(Query) or a deleteDocuments(int docid) call), but I don't see why this can't be fixed without adding new concepts (like UID) to the index. Or maybe I'm missing something? -- Nadav Har'El | Wednesday, Jan 23 2008, 17 Shevat 5768 IBM Haifa Research Lab |----------------------------------------- |War doesn't determine who's right but http://nadav.harel.org.il |who's left. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]