I'm using ElasticSearch 6.7.2 and I have a massive amount of documents organized on daily indexes. So, for financial reasons, I decided to snapshot the old indexes (with more than 9 months) in Google Cloud Storage and only restore them when it's needed.
I decided build an Elastic's plugin. This plugin has to verify if the searched index exists or not on cluster. If not, restores it from Cloud Storage. I'm trying to do that with an ActionFilter class , "intercepting" the _search requests and perform the aforementioned steps.
But I can not check if the index exists in the database. How am I supposed to do that? An ActionFilter class is the correct to use on my case? I cannot find many documentation about build ElasticSearch plugins and many of tutorials I have been finding are deprecated for the newer versions.
Sorry, I should have mentioned it. We talk about disks cost. If I keep all my indices on ElasticSearch's cluster, I will have more or less 32TB of data. Performing the snapshot and restore as aforementioned, I will keep only 2TB of data online on my cluster.
I already saw this solution. The problem is again the cost. Using spinning disks my cost will be, on a conservative estimate, 260 times great then the Cloud Storage Solution. So, I chose build the plugin to automated the restore process. I only need to know how test if an index exists or not and how perform the restore inside the Elastic's plugin code.
For future viewers, I was able to solve the problem Overriding the Plugin class method createComponents and get the Client object parameter. But as you can see in this post Create a plugin that needs a client isn't a beautiful way, but works.
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.