[
https://issues.apache.org/jira/browse/SOLR-6399?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14104698#comment-14104698
]
dfdeshom commented on SOLR-6399:
--------------------------------
Looking at the `deleteCollection` API implementation, it looks like it's using
`CoreContainer.unload()`, but with the option of deleting the cores' contents.
Relevant source code:
https://github.com/apache/lucene-solr/blob/trunk/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java#L944-953
One could modify this `deleteCollection` to accepts parameters to
`DELETE_INSTANCE_DIR` and `DELETE_DATA_DIR` . I tried doing that and the issues
I ran into were:
- after the core was unloaded, it was absent from the collection list, as if
it never existed. On the other hand, re-issuing a CREATE call with the same
collection restored the collection, along with its data
- upon restart Solr tried to reload the previously-unloaded collection.
In both cases, it looks like having an `isActive` attribute to a collection
would help. Any pointers as to where to set and check that data would be
appreciated.
> Implement unloadCollection in the Collections API
> -------------------------------------------------
>
> Key: SOLR-6399
> URL: https://issues.apache.org/jira/browse/SOLR-6399
> Project: Solr
> Issue Type: New Feature
> Affects Versions: 4.9
> Reporter: dfdeshom
> Fix For: 5.0
>
>
> There is currently no way to unload a collection without deleting its
> contents. There should be a way in the collections API to unload a collection
> and reload it later, as needed.
> A use case for this is the following: you store logs by day, with each day
> having its own collection. You are required to store up to 2 years of data,
> which adds up to 730 collections. Most of the time, you'll want to have 3
> days of data loaded for search. Having just 3 collections loaded into memory,
> instead of 730 will make managing Solr easier.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]