Plugin - How to intercept a shard query phase and reject?

Hello, am toying with a plugin and am trying to add some behavior where I can intercept a query happening at the shard level.

This can be done it seems through the SearchOperationListener with the onPreQueryPhase and onQueryPhase.

I'd like to be able to do some validations inside these and reject the shard query phase based on those validations. i.e. if so and so is true fail this specific shard search.

It seems the exceptions thrown from inside the listeners are caught and logged as warnings and silently ignored otherwise. Is there a way to fail the shard query phase from inside these hooks or is there a better way to do this?

Thanks

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.