I'd like to see this improvement request implemented - but I'm not sure
if 1.9 or 2.0 would be a better place to do it:
http://issues.apache.org/jira/browse/LUCENE-301
Short summary - The Constructor for IndexWriter currently will only
create an index in a folder if you set the boolean create flag to true.
But then, if you want to append to that index, you have to set the
create flag to false (otherwise it overwrites)
In my use cases, I seldom want to overwrite an index - but I often
create new ones, and append to existing ones. Forgetting to switch the
boolean flag between the initial create and the append causes data loss.
To me, a better, safer API would be to change the parameter named
"create" into "clear" - and then change the behavior so that is always
creates a new index at the specified location if one doesn't already exist.
If clear is false - it would append (same as current behavior) - and if
clear is true is would clear first, and then create a new index. So
nobody using the API should break.
Dan
--
****************************
Daniel Armbrust
Biomedical Informatics
Mayo Clinic Rochester
daniel.armbrust(at)mayo.edu
http://informatics.mayo.edu/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]