Create a note using Solr

NOTE
  • Before creating a note, make sure that the Solr interpreter is configured according to the article Install a third-party interpreter.

  • The example is based on the Solr collection people_ages that contains names and age of 1000 people. The sample dataset is available for download using the direct link.

  1. In the Zeppelin web UI, click the Create new note list item or click the main menu item Notebook → Create new note.

    Adding a new note
    Adding a new note
    Adding a new note
    Adding a new note
  2. In the opened dialog, enter the note name and select the default interpreter that will be used in cases when the interpreter type is not specified explicitly. Notice that you can create different folders for your notes. Then, click Create.

Describing a new note
Describing a new note
Describing a new note
Describing a new note
  1. In the opened window, click the Interpreter binding icon to view the available interpreters.

    Switch to binding interpreters
    Switch to binding interpreters
    Switch to binding interpreters
    Switch to binding interpreters
  2. Verify that the interpreter %solr is selected in the opened list; select it otherwise. Then, click Save.

    Saving an interpreter
    Saving an interpreter
    Saving an interpreter
    Saving an interpreter
  3. In the first paragraph of your note, enter the command that sets the default collection to be selected from Solr (if any other is not defined).

    use people_ages

    Then, click Run this paragraph to execute the code.

    Setting the default Solr collection
    Setting the default Solr collection
    Setting the default Solr collection
    Setting the default Solr collection
    TIP
    If you do not specify the interpreter name, the default one is used — %solr.
  4. In the second note paragraph, enter the following query. The query returns the number of people grouped by age.

    facet q=*:*&facet=true&facet.field=Age

    The result is shown below.

    Result table
    Result table
    Result table
    Result table
  5. Click the Bar Chart icon to switch to a different view mode.

    A bar chart
    A bar chart
    A bar chart
    A bar chart
  6. You can also use SQL statements. Enter the following code in the third paragraph:

    SELECT MIN(Age) AS Minimum, MAX(Age) AS Maximum FROM people_ages

    It returns the minimum and the maximum people age values.

    Running an SQL query
    Running an SQL query
    Running an SQL query
    Running an SQL query
Found a mistake? Seleсt text and press Ctrl+Enter to report it