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 Manohar Sripada <ma...@gmail.com> on 2014/12/08 11:02:13 UTC

Clearing SolrCaches

Hi,

Can anyone please let me know on how to clear caches associated with an
IndexSearcher explicitly?

In my project, I am creating a collection (say collection_1) which holds
the data for my organizations dataset. I am using filterCache,
queryResultCache and DocumentCache extensively and these are all loaded
through some EvenListeners and/or over a period of time.

Periodically, I get new dataset of organizations. For this new dataset, I
am creating a new collection (say collection_2).

Now, my client searches only on collection_2 not on collection_1 any more.
But, I am still keeping my collection_1 as a backup in SolrCloud. *Here*, I
don't want the cache to be hold by IndexSearcher of all the cores of
collection_1 any more, as no one uses this. How to clear this cache?

*Note: *I am not using my collection for real-time updates. The index is
created from bulk data and there will be only one commit on data.

Thanks,
Manohar

Re: Clearing SolrCaches

Posted by Shawn Heisey <ap...@elyograg.org>.
On 12/8/2014 11:10 PM, Manohar Sripada wrote:
> How to edit the configuration that is linked to a collection?? I am using
> SolrCloud and I upload my config to Zookeeper. So, if I modify and upload
> the config, will that not impact the latest collection as well, if I don't
> reload the latest collection?

Yes, you would need to change the config and re-upload it to zookeeper
before you do the reload.  Any collections linked to that config will
use the new config on reload or when a new collection linked to that
config is created.

The scenario I have described probably requires that you have more than
one config in zookeeper - one that has the caches and warming configured
for production, and one that doesn't, plus any other configs you might
require.  You could re-link the "old" collection to the config with no
caches before you reload it.

Thanks,
Shawn


Re: Clearing SolrCaches

Posted by Manohar Sripada <ma...@gmail.com>.
How to edit the configuration that is linked to a collection?? I am using
SolrCloud and I upload my config to Zookeeper. So, if I modify and upload
the config, will that not impact the latest collection as well, if I don't
reload the latest collection?

Thanks,
Manohar

On Mon, Dec 8, 2014 at 7:45 PM, Shawn Heisey <ap...@elyograg.org> wrote:

> On 12/8/2014 3:02 AM, Manohar Sripada wrote:
> > Can anyone please let me know on how to clear caches associated with an
> > IndexSearcher explicitly?
> >
> > In my project, I am creating a collection (say collection_1) which holds
> > the data for my organizations dataset. I am using filterCache,
> > queryResultCache and DocumentCache extensively and these are all loaded
> > through some EvenListeners and/or over a period of time.
> >
> > Periodically, I get new dataset of organizations. For this new dataset, I
> > am creating a new collection (say collection_2).
> >
> > Now, my client searches only on collection_2 not on collection_1 any
> more.
> > But, I am still keeping my collection_1 as a backup in SolrCloud.
> *Here*, I
> > don't want the cache to be hold by IndexSearcher of all the cores of
> > collection_1 any more, as no one uses this. How to clear this cache?
>
> I don't think there is any way to do EXACTLY what you are asking.
>
> If you reload the collection (or each of its cores), then the cache will
> be cleared and re-created, and will only contain data queried by the
> firstSearcher event listener.  If you edit the configuration linked to
> that collection (or link another suitable config, assuming SolrCloud) to
> remove the cache configurations and the event listeners, then there will
> be no cache when you reload it.
>
> Thanks,
> Shawn
>
>

Re: Clearing SolrCaches

Posted by Shawn Heisey <ap...@elyograg.org>.
On 12/8/2014 3:02 AM, Manohar Sripada wrote:
> Can anyone please let me know on how to clear caches associated with an
> IndexSearcher explicitly?
> 
> In my project, I am creating a collection (say collection_1) which holds
> the data for my organizations dataset. I am using filterCache,
> queryResultCache and DocumentCache extensively and these are all loaded
> through some EvenListeners and/or over a period of time.
> 
> Periodically, I get new dataset of organizations. For this new dataset, I
> am creating a new collection (say collection_2).
> 
> Now, my client searches only on collection_2 not on collection_1 any more.
> But, I am still keeping my collection_1 as a backup in SolrCloud. *Here*, I
> don't want the cache to be hold by IndexSearcher of all the cores of
> collection_1 any more, as no one uses this. How to clear this cache?

I don't think there is any way to do EXACTLY what you are asking.

If you reload the collection (or each of its cores), then the cache will
be cleared and re-created, and will only contain data queried by the
firstSearcher event listener.  If you edit the configuration linked to
that collection (or link another suitable config, assuming SolrCloud) to
remove the cache configurations and the event listeners, then there will
be no cache when you reload it.

Thanks,
Shawn