Listeners, cores and Similarity

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Listeners, cores and Similarity

Marc Sturlese
Hey there,
I'm testing a custom similarity which loads data from and external file located in solr_home/core_name/conf/. I load data from the file into a Map on the init method of the SimilarityFactory. I would like to reload that Map every time a commit happens or every X hours.
To do that I've thought on implementing a custom listener which populates a custom cache (working as the Map) every time a new searcher is opened. The problem is that from the SimilarityFactory or Similarity class I can't access the Solr caches, just have access to the SolrParams.
The only way I see to populate the Map outside the Similarity class is making it static but would like to avoid that.
Any advice?
Thanks in advance