Hello, Abhishek. It seems config api lacks usercache functionaly, thus it deserves jira. Inserting user cache in runtime seems undoable, the closed option is to modify solrCore.SolrConfg.userCacheConfigs and obtain new SolrIndexSearch after that, but the latter is a tricky thing to achieve.
Another idea is to define one user cache in solrconfig holding other on-demand caches. On Tue, Jun 4, 2019 at 7:17 PM Abhishek Dnyate <abhis...@cumulus-systems.com> wrote: > Hi, > > I am trying make use of User Defined cache functionality to optimise a > particular workflow. > We are using Solr 7.4. > > Step 1. I noticed, first we would have to add Custom Cache entry in > solrconfig.xml. > What’s its Config API alternative for solrCould ? > I couldn’t find one at, > https://lucene.apache.org/solr/guide/7_4/config-api.html (or may be I > missed it). > Could anyone point out to some link ? > > Step 2. In step 2, to insert the required cache, I could see there is > cacheInsert() method available for SolrIndexSearcher class. > I am not sure how to build object for this class. > I started with CoreContainer object, which just needs SOLR_HOME for > initialisation. > From this I was trying to get SolrCore objects. > And then I was trying to build object of SolrIndexSearcher from above > SolrCore class objects : > => SolrIndexSearcher newSearcher = new SolrIndexSearcher(_core, > _core.getNewIndexDir(), _core.getLatestSchema(), > > _core.getSolrConfig().indexConfig, “test query", false, > _core.getDirectoryFactory()); > > > But getAllCoreNames return me empty list of SolrCore objects. So it didn’t > work. > Not sure, what am I missing , any pointer would be greatly appreciated. > > > Regards, > Abhishek > > -- Sincerely yours Mikhail Khludnev