You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Abhishek Dnyate <ab...@cumulus-systems.com> on 2019/06/04 09:42:33 UTC

Custom cache for Solr Cloud mode

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


Re: Custom cache for Solr Cloud mode

Posted by Shawn Heisey <ap...@elyograg.org>.
On 6/7/2019 8:49 AM, Erick Erickson wrote:
> Yes. ZooKeeper has a “blob store”. See the Blob Store API in the ref guide.
> 
> Minor nit. You will be creating  a jar file, and configuring your collection to be able to find the new jar file.  Then you _upload_ both to ZooKeeper and reload your collection. The rest should be automatic, Solr  should look for the  jar file in ZooKeeper and pull it down locally to each node as necessary.

I thought the blob store was the .system collection (ultimately a Lucene 
index) ... hadn't ever heard of uploading a jar to ZK.  The 
documentation seems to concur.

https://lucene.apache.org/solr/guide/7_5/blob-store-api.html

Thanks,
Shawn

Re: Custom cache for Solr Cloud mode

Posted by Erick Erickson <er...@gmail.com>.
Yes. ZooKeeper has a “blob store”. See the Blob Store API in the ref guide.

Minor nit. You will be creating  a jar file, and configuring your collection to be able to find the new jar file.  Then you _upload_ both to ZooKeeper and reload your collection. The rest should be automatic, Solr  should look for the  jar file in ZooKeeper and pull it down locally to each node as necessary.

Best,
Erick

> On Jun 6, 2019, at 11:06 PM, abhishek <ab...@cumulus-systems.com> wrote:
> 
> 
> Thanks for the response.
> 
> Eric, 
> Are you suggesting to download this file from zookeeper, and upload it after
> changing ? 
> 
> Mikhail,
> Thanks. I will try solrCore.SolrConfg.userCacheConfigs option.
> Any idea why, CoreContainer->getCores() would be returning empty list for me
> ?
> 
> (CoreAdminRequest.setAction(CoreAdminAction.STATUS);
> CoreAdminRequest.process(solrClient); -> gives me list of cores correctly)
> 
> -Abhishek
> 
> 
> 
> 
> --
> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html


Re: Custom cache for Solr Cloud mode

Posted by abhishek <ab...@cumulus-systems.com>.
Thanks for the response.

Eric, 
Are you suggesting to download this file from zookeeper, and upload it after
changing ? 

Mikhail,
Thanks. I will try solrCore.SolrConfg.userCacheConfigs option.
Any idea why, CoreContainer->getCores() would be returning empty list for me
?

(CoreAdminRequest.setAction(CoreAdminAction.STATUS);
CoreAdminRequest.process(solrClient); -> gives me list of cores correctly)

-Abhishek




--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Re: Custom cache for Solr Cloud mode

Posted by Erick Erickson <er...@gmail.com>.
Last I knew, you could define a userCache statically in solrconfig.xml, even if you can’t use the config API to insert one….

> On Jun 5, 2019, at 2:22 AM, Mikhail Khludnev <mk...@apache.org> wrote:
> 
> 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 <ab...@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


Re: Custom cache for Solr Cloud mode

Posted by Mikhail Khludnev <mk...@apache.org>.
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 <ab...@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