Create a note using Solr
NOTE
|
-
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 noteAdding a new note -
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.


-
In the opened window, click the Interpreter binding icon to view the available interpreters.
Switch to binding interpretersSwitch to binding interpreters -
Verify that the interpreter
%solr
is selected in the opened list; select it otherwise. Then, click Save.Saving an interpreterSaving an interpreter -
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 collectionSetting the default Solr collectionTIPIf you do not specify the interpreter name, the default one is used —%solr
. -
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 tableResult table -
Click the Bar Chart icon to switch to a different view mode.
A bar chartA bar chart -
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 queryRunning an SQL query