Updated on 2024-11-29 GMT+08:00

Operations on the Solr Admin UI

Log in to Manager choose Cluster > Name of the desired cluster > Service > Solr, and ensure that all Solr instances are working properly. Click SolrServerAdmin (select one from the two options) on the Solr WebUI to go to the Solr Admin page.

  1. Creating a collection

    On the Solr Admin page, choose Collections > Add Collection, enter a name, select a config set, and set NumShards (number of shards) and replicationFactor (number of replicas).

    You are advised to limit the alias name and collection name at 255 characters while creating a collection, otherwise it might affect the performance of ZooKeeper and Solr. For more information please refer to Solr service configuration SOLR_COLLECTION_CORE_MAX_LENGTH.

    Figure 1 Creating a collection

    Click Add Collection. The created collection is displayed on the Cloud page,

  2. Add a document using the following URL:

    Switch to the Solr Admin page, select a desired collection from Collection Selector, click Documents, and specify the fields that need to be added, as shown in Figure 2.

    Figure 2 Adding a document

    You can also create collection by uploading a file on the page. The ID fields included in the file for uploading need to be defined in the Solr configuration file schema.xml. You also need to enter the update type of the file to be uploaded in the Extracting Req. Handler Params text box. (The maximum size of the file to be uploaded is 2 GB.) For example, to upload a CSV file to create an index, set Document type to File Upload. Enter &update.contentType=application/csv&commit=true in the Extracting Req. Handler Params text box, as shown in Figure 3.

    Figure 3 Uploading a file to create a collection
  3. Querying indexes

    On the Solr Admin page, select a desired collection from Collection Selector, click Query, and click Execute Query to view the added data, as shown in Figure 4.

    Figure 4 Querying collection data
  4. Run the following command to delete collection data:

    On the Solr Admin page, select a desired collection from Collection Selector, click Documents, select the XML format, and enter the following information in Document(s): <delete><query>*:*</query></delete><commit/>. Then you can delete all collection data to which the core belongs. After the deletion, you can query the collection data and find that it does not exist, as shown in Figure 5.

    Figure 5 Deleting collection data
  5. Deleting a Collection

    On the Solr Admin page, click Collections, select the collection to be deleted, click Delete collection, enter the collection to be deleted, and click Delete again. The collection is deleted, as shown in Figure 6.

    Figure 6 Deleting a collection