On Wed, Oct 11, 2006 at 12:09:40PM -0400, Erick Erickson wrote: > No problem. Partly, it's helping me clarify my current problem <G>.... > > Yes, you must delete and re-add a document to change it. You might want to > look at the IndexModifier class. Be aware of some things: > 1> Lucene doc IDs may change when the index is changed, I think after > optimization. So, in order to find specific docs you'll want to add a unique > ID field. > 2> deleteing a document only marks it as deleted. It's still actually in the > index (although you won't be able to see it). Optimizing an index actually > physically removes it (and shrinks the index size). > 3> after changing an index, you must open a new IndexReader before you see > the changes. > 4> The only information you can reliably get out of an index is data you've > stored (e.g. Field.Store.YES). This only matters if you're trying to read > the doc *from* the index and change it. If you're just replacing it with a > fresh copy from somewhere else (e.g. re-reading the doc from the database), > it's not a problem. > 5> Lucene has no notion of constraints. That is, Lucene is perfectly happy > with two identical documents in the index, so be sure to delete before you > add <G>....
Thats great! Looks like the solution I needed, because each record will definitely has unique ID, I need to just index document and it's comments - not store contents etc, and I don't need any constraints! I just need to search for something, which search will return set of that unique IDs (those IDs are obtained from a database). Thank you very much for all your help! -- Eugene N Dzhurinsky --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]