You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Kai Gülzau <kg...@novomind.com> on 2011/11/09 17:26:18 UTC
DIH -> how to collect added/error unique keys?
Hi *,
I am using DataImportHandler to do imports on a INDEX_QUEUE table (UKEY | ACTION)
using a custom Transformer which adds fields from various sources depending on the UKEY.
Indexing works fine this way.
But now I want to delete the rows from INDEX_QUEUE which were successfully updated.
-> Is there a good "API way" to do this?
Right now I'm using custom RequestProcessor which collects the UIDs and calls a method
on a singleton with access to the DB. It works but I hate these global singletons... :-(
public void processAdd(AddUpdateCommand cmd) throws IOException {
SolrInputDocument doc = cmd.getSolrInputDocument();
try {
super.processAdd(cmd);
addOK(doc);
} catch (IOException e) {
addError(doc);
throw e;
} catch (RuntimeException e) {
addError(doc);
throw e;
}
}
Any other suggestions?
Regards,
Kai Gülzau