removedTerm = new Term(key, (String) keyValue);
} else {
// FIXME: should throw an exception for illegal input data but this would leave the index in an incoherent state
+ getLogger().error("Attempting to remove document from index of {} with key {} and unrecognized key value type {} : {}", input, key, keyValue, keyValue != null ? keyValue.getClass() : "null");
continue;
}
boolean done = false;
if(requireChangeInfoOnReplace()) {
TopDocs exist = searcher.search(new TermQuery(removedTerm), null, 2);
- if(exist.scoreDocs.length == 1 && requireChangeInfoOnReplace()) {
+ if(exist.scoreDocs.length == 1) {
Document doc = reader.document(exist.scoreDocs[0].doc);
if(!areSame(doc, document)) {
writer.deleteDocuments(removedTerm);