would it be possible to catch all Elasticsearch requests, from a plugin, in order to enrich them by adding some filters without changing the query client-side?
E.g. user calls GET /_search and I will add:
Thanks for the answer @dadoonet, unfortunately I cannot use aliases because I need to add those filters in a transparent way so that user still keeps doing the same requests in the same way.
@dadoonet, ok but when user make a normal and usual call (in the example GET /_search) how can I catch that call in the plugin to block it and replace it with another call to the previously created alias?
also, this would required to first create aliases for each filter I want to use in my Elasticsearch and I would like to avoid it.
The alias feature could be useful in my case, but just in case I will be able to replace the normal request a user is making with a custom one so that I could dynamically create an alias with a specific filter and then make the filtered request instead of the original one.
Based on the filters I want to add for the specific request.
Anyway, so there is no way to catch requests from an Elasticsearch plugin in order to replace them somehow?
Based on the filters I want to add for the specific request.
So I don't understand... Can't you just do that by yourself in your application?
I mean that yes you can probably do that within a plugin but this is looking over engineering to me. Unless I'm missing something. Writing and more than that, maintaining a plugin, is not something that trivial IMHO.
That's why I'm asking and trying to check if you really need that.
I mean that yes you can probably do that within a plugin but this is looking over engineering to me. Unless I'm missing something. Writing and more than that, maintaining a plugin, is not something that trivial IMHO.
That's why I'm asking and trying to check if you really need that.
yes you are right and thank you for that.
The problem is that I am really unable to touch the application making requests, besides the plugin will be used on generic Elasticsearch instances that are called by different and generic applications.
Do have any idea about where I can start to try something from the plugin in order to do what I need?
Any specific class I need to extend or methods to override in order to catch the request?
If you can not change the application, how do you know what filter you need to apply when someone just call GET /_search? There's no parameter to decide... I think I'm lost.
I get those information about filters from an external service I call where the source application put specific filters I will use in the plugin.
I know it sound strange but there is reason for logic.
yes I know about it and also found an official example about how to create a custom REST endpoint, but unfortunately it's not helpful for my needs.
thank you, I'll try to look at it and will report here in case of progress.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.