Access Indexreader object in search context of an elastic search plugin

I am new to Elasticsearch plugins and finding difficult on how to access Indexreader object in a plugin while performing the searching request of an index. I want something like this.
A user performs the search request

Post my_index/Plugin-Test/_search

On executing the above, Plugin-Test should be called with access of the Indexreader object.

Please provide me sample code for the same

You may want to take a look at the SearchPlugin interface in Elasticsearch, that you plugin might want to implement.

Note, that you cannot overwrite the above endpoint, you can only extend the query functionality.

If you want to take a look at some example plugins, take a look at https://github.com/elastic/elasticsearch/tree/6.3/plugins/examples

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