You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@solr.apache.org by Nazerke S <sn...@gmail.com> on 2022/11/09 21:21:35 UTC

SolrEventListener configuration in solr 8 vs solr 9

Hi All,

I was trying to configure event listener in solrconfig.xml and observed
that in Solr 9 event listener should be inside updateHandler otherwise it
wouldn't work:

<updateHandler>
     <listener event="postCommit" class="x.y.z" />
</updateHandler>

However, in Solr 8x it works regardless of putting it inside updateHandler.

Is it intentional change in Solr 9 or am I doing something wrong, missing
something ?


Thanks,

Nazerke

Re: SolrEventListener configuration in solr 8 vs solr 9

Posted by David Smiley <ds...@apache.org>.
I used IntelliJ's "Find By XPath" to see that there is no occurrence of a
/config/listener but there is /config/query/listener and
/config/updateHandler/listener.
Furthermore, the Solr Ref guide documents
https://solr.apache.org/guide/solr/latest/configuration-guide/commits-transaction-logs.html#updatehandler-in-solrconfig-xml
and
https://solr.apache.org/guide/solr/latest/configuration-guide/caches-warming.html#query-related-listeners
with a TOC that each shows stuff under <updateHandler> or <query>

So if it worked before 9, it was quite by accident.  It could be worth
documenting in the upgrade notes.  I suspect this change happened when we
moved away from XPath processing of this file.

~ David Smiley
Apache Lucene/Solr Search Developer
http://www.linkedin.com/in/davidwsmiley


On Wed, Nov 9, 2022 at 4:21 PM Nazerke S <sn...@gmail.com> wrote:

> Hi All,
>
> I was trying to configure event listener in solrconfig.xml and observed
> that in Solr 9 event listener should be inside updateHandler otherwise it
> wouldn't work:
>
> <updateHandler>
>      <listener event="postCommit" class="x.y.z" />
> </updateHandler>
>
> However, in Solr 8x it works regardless of putting it inside updateHandler.
>
> Is it intentional change in Solr 9 or am I doing something wrong, missing
> something ?
>
>
> Thanks,
>
> Nazerke
>