You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Alex Genaille (JIRA)" <ji...@apache.org> on 2015/03/20 18:55:38 UTC

[jira] [Updated] (SOLR-7277) DocBuilder should pass EntityProcessorWrapper in notifyListener

     [ https://issues.apache.org/jira/browse/SOLR-7277?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alex Genaille updated SOLR-7277:
--------------------------------
    Summary: DocBuilder should pass EntityProcessorWrapper in notifyListener  (was: DocBuild should pass EntityProcessorWrapper in notifyListener)

> DocBuilder 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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org