What I'm considering doing is reading the file with mulitple documents twice. One time I test to see if the document is in the index and delete it if it is with something like:
The "Reference" term is unique.
...
while(String ref = getNextDocument() != null) {
Term t = Term("Reference",ref);
TermDocs td = indexReader.termDocs(t);
if(td != null) {
td.next();
indexReader.delete(td.doc());
}
}Or should I not bother to look for the term at all and do something like this?
while(String ref = getNextDocument() != null) {
Term t = Term("Reference",ref);
indexReader.delete(t);
}
Are either of these more efficient.Then I would close the indexReader and go back and reread the file, indexing merrily away.
Should I be concerned about keeping both an indexReader and indexWriter open at the same time? I'll have other processes probably making searches during this time. I'm not concerned about the searches not finding the data I'm currently adding, I'm more concerned about locking those searches out.
A couple of valid assumptions. The reference term is unique in the index and there will be only one in the input file.
Comments?
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
