Create Solr target collection

Learn how you can create collections in Solr. Data is stored in collections, which are single indexes distributed across multiple servers.

Before you can ingest data into Apache Solr, you need a target Solr collection prepared to receive the data. For more information about Solr, see the Cloudera Search Overview.
  1. Navigate to your Data Discovery and Exploration (DDE) cluster and click Hue in the Services section of the DDE cluster overview page.
  2. On the Hue web UI, select Indexes > + Create index.
  3. From the Type drop-down, select Manually and click Next.
  4. Provide a collection name under Destination.
    In this example, we named the collection solr-nifi-demo.
  5. Add the following fields, using + Add Field.
    Name Type
    name text_general
    initial_release_date date
  6. Click Submit.
  7. To check that the collection has been created, go to the Solr web UI by clicking the Solr Server shortcut in the Services section of the DDE cluster overview page.
  8. Execute the collection query.
    1. Click the Collections sidebar option or click Select an option.
      In the drop-down you will find the collection you have just created. In our example it is solr-nifi-demo.
    2. Click the name of the collection.
    3. Click Query > Execute Query.
      The query output should look like this:
      {
        "responseHeader":{
          "zkConnected":true,
          "status":0,
          "QTime":0,
          "params":{
            "q":"*:*",
            "doAs":"<querying user>",
            "_forwardedCount":"1",
            "_":"1599835760799"}},
        "response":{"numFound":0,"start":0,"docs":[]
      }}
      
You have successfully created an empty collection.