Creating and Managing Collections
Here, we will explain how to create (add) and manage collections.
Page Sections
What is a Collection?
A collection is a unit for storing and managing searchable data, configuration files, plugin programs, etc. An inverted index is created for each collection. Collections are equivalent to tables in a database.
In Apache Solr, there is a concept called 'Core'. 'Core' refers to individual instances of Apache Solr. In a standalone configuration of Solr, cores and collections can be considered the same.
In a SolrCloud configuration, a single collection may be divided into multiple logical shards. When creating a collection, specifying the number of shards and the replication factor can enable load balancing, improve durability, or both.
How to add a collection
You can add multiple collections to a KandaSearch instance, and there is no limit to the number of collections that can be added.
The method for adding collections is as follows:
- Log in to KandaSearch.
- From the list of projects, click on the desired project name. (To display the list of projects, click on the KandaSearch logo in the top left corner of the screen.)
- From the project overview, click on the instance name to which you want to add the collection.
- From the left side menu of the instance view, click on 'Collections'.
- Click on '+ ADD A COLLECTION' within the 'Collections' screen.
From the displayed dialog box, create a collection using one of the following two methods.
New Creation
In the 'NEW' tab, you can create a collection using the basic settings of Apache Solr.
After creating the collection, you can complete it by directly editing each configuration file from 'Config' or 'File Manager', or by editing it on a local PC, etc., after exporting (as explained in the following section) and then importing (as explained in the following section).
The creation method is as follows:
- Select the 'NEW' tab.
- Specify the collection name. The collection name can consist of alphanumeric characters, hyphens (-), underscores (_), and dots (.), with a length of 1 to 15 characters. The string specified here will be used as part of the URL when accessing the collection. For SolrCloud configuration, select the shard (number of shards) and replication factor (number of replications), with the number of nodes as the upper limit.
- Click 'SAVE'.
- Upon successful creation of the collection, it will be added to the list on the 'Collections' screen.
Creation via Import
In the 'IMPORT' tab, you can create a collection by importing a zip file of configuration settings downloaded from the extension library, or a zip file of custom configuration settings. The creation method is as follows:
- Select the 'IMPORT' tab.
- Drag and drop the file from your local PC, created in zip format, into the dashed border frame, or click 'CHOOSE A FILE' within the dashed border frame to specify the file.
- Specify the collection name. The collection name can consist of alphanumeric characters, hyphens (-), underscores (_), and dots (.), with a length of 1 to 15 characters. The string specified here will be used as part of the URL when accessing the collection. For SolrCloud configuration, select the shard number and replication factor, with the number of nodes as the upper limit.
- Click 'SAVE'.
- Upon successful creation of the collection, it will be added to the list on the 'Collections' screen.
Notes.
- There is a maximum limit (15MB) for the size of the specified zip file.
Managing Collections
In the 'Collections' screen, you can perform the following management operations for added collections:
- List of added collections: Displays collection names and various operation buttons. For SolrCloud configuration, it also displays the number of shards and replication factor.
- Copy Collection URL (Memo icon): Copies the 'URL for accessing the collection from external sources', which can be used in Solr APIs, to the clipboard.
- Reload (Reload icon): Allows reloading of configuration files or synonym dictionaries. To reload, click 'CONFIRM' in the 'Collection Reload' dialog box.
- MORE: Allows importing, exporting, deleting documents, and deleting collections. (Details explained below)
Import
From the 'Import' option under 'MORE', you can overwrite the configuration settings of a collection through importing.
The import method is as follows:
- Select 'Import' from the 'MORE' of the target collection.
- The "Import into collection CLLECTION-NAME" dialog box will appear. Drag and drop the file from your local PC, created in zip format, into the dashed border frame, or click 'CHOOSE A FILE' within the dashed border frame to specify the file.
- If you check the checkbox for 'Delete the conf directory', the current config directory will be deleted before importing. This is useful for setting up a clean environment with new data.
- If you check the checkbox for 'Reload automatically after the import is completed', the collection will be reloaded after the import process.
- Finally, click 'CONFIRM'.
Notes.
- There is a maximum limit of 15MB for the size of the specified zip file.
- After completing the import operation, it is not possible to revert the data to its previous state.
Export
From the 'Export' option under 'MORE', you can export the configuration settings of a collection. To perform an export, select 'Export' from the 'MORE' of the target collection, and the export will begin immediately.
Delete Documents
'Delete documents' from 'MORE' allows you to delete all documents within the collection.
To delete documents, select 'Delete Documents' from the 'MORE' of the target collection.
Click 'CONFIRM' in the 'Collection Documents Deletion' dialog box that appears.
Notes.
- After completing the document deletion operation, it is not possible to revert the data to its previous state.
- Documents can be deleted (bulk deletion or deletion of specific documents) using the Solr API.
Delete
'Delete' from 'MORE' allows you to delete the collection.
The method for deleting a collection is as follows:
- Select 'Delete' from the 'MORE' of the target collection.
- The 'Collection Deletion' dialog box will appear. If you uncheck the 'Delete the instance directory' checkbox, the folder where the configuration settings are saved will remain without deletion. For SolrCloud configuration, it is also possible to specify deletion of collection-related data from ZooKeeper by checking the 'Delete collection-related data from ZooKeeper' checkbox.
- Clicking 'DELETE' will remove the collection.
Notes.
- After the deletion process is completed, it is not possible to revert the data.