[
https://issues.apache.org/jira/browse/SOLR-8731?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15172523#comment-15172523
]
Dean Gurvitz commented on SOLR-8731:
------------------------------------
I wanted to add the reason I submitted this patch:
Recently I was writing a search component that needs to save and use
information about all queries running at a given moment. In the "prepare"
method it adds the necessary information to a shared hashmap, and in one of the
final calls to "finishStage" it removes it. In case of an exception thrown by
another search component, the information about the unsuccessful query gets
stuck in my hashmap, which creates a very big problem for me.
The "onException" mechanism allows me to make sure I remove the information
about a specific query whether it succeeded or not. Locally I used it by
inheriting from SearchHandler and from SearchComponent, but I think this
functionality belongs in the original classes, and wanted to share my idea with
the community.
> onException behavior in search components
> -----------------------------------------
>
> Key: SOLR-8731
> URL: https://issues.apache.org/jira/browse/SOLR-8731
> Project: Solr
> Issue Type: New Feature
> Components: SearchComponents - other
> Affects Versions: master
> Reporter: Dean Gurvitz
> Priority: Minor
> Labels: features, newdev
> Fix For: master
>
> Attachments: SOLR-8731.patch
>
>
> The idea is to allow search components to execute logic in case an exception
> was thrown while processing a query.
> A new "onException" function can be added to the SearchComponent class. Then,
> parts of SearchHandler's handle-request functions can be surrounded in a
> try-catch block, where onException is called within the catch section on all
> relevant SearchComponents.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]