Alex Genaille created SOLR-7277:
-----------------------------------
Summary: DocBuild should pass EntityProcessorWrapper in
notifyListener
Key: SOLR-7277
URL: https://issues.apache.org/jira/browse/SOLR-7277
Project: Solr
Issue Type: Bug
Components: contrib - DataImportHandler
Affects Versions: 5.0
Environment: Windows 7; Apache Solr 5.0.0
Reporter: Alex Genaille
Within an onImportEnd listener, I would like to be able to do this:
{code}
String entityName = context.getEntityAttribute("name");
{code}
Because the DocBuilder.notifyListener passes a null EntityProcessorWrapper, the
entity is not accessible at all in the onImportEnd event.
Suggested Fix: DocBuilder.notifyListener should pass the
currentEntityProcessorWrapper into the ContextImpl constructor on line 173 of
DocBuilder.java
{code}
private void notifyListener(EventListener listener, Exception lastException) {
String currentProcess;
if (dataImporter.getStatus() == DataImporter.Status.RUNNING_DELTA_DUMP) {
currentProcess = Context.DELTA_DUMP;
} else {
currentProcess = Context.FULL_DUMP;
}
ContextImpl ctx = new ContextImpl(null, getVariableResolver(), null,
currentProcess, session, null, this); //FIX: PASS first argument
ctx.setLastException(lastException);
listener.onEvent(ctx);
}
{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]