Elastic search plugin to inject query filter

Hello,

I am developing an application that connects to Elasticsearch using Java TransportClient API. I want to deploy an elastic search plugin that will inject a query filter into all search requests. The plug-in itself will create this filter by retrieving a list of values from an external repository. This list can possibly be very long and want to avoid repeatedly transferring this list over the network. Can you please clarify whether developing and deploying such a plugin is feasible? If feasible, can you please share pointers on where to start(documentation, example plugin, etc.) to develop such a plugin?

I suppose such a filter can be injected into REST requests by creating a RestFilter and deploying it as a plug-in. I want to develop similar plugin for transport client.

Any help will be greatly appreciated!

Regards,
Shashi

Hey,

how about using an alias with a terms filter lookup (not sure this works on top of my head, but worth a try)? Otherwise you could write your own plugin with your own filter and lookup mechanism, but be very careful to not kill your query performance.

--Alex

Hi Alex,

Thanks for the reply! I want implement the plug-in to inject the query filter, but I am not able to identify which class should I extend or which interface should I implement in the plug-in to inject this filter when external application connects to elastic search using transport API. Can you please let me know if you have pointers here?

Hey,

the SearchModule registers the different query parsers... so your plugin needs to add a module that registers your own query parser.

--Alex