/zeppelin-solr

Apache Solr interpreter for Apache Zeppelin

Primary LanguageScalaApache License 2.0Apache-2.0

Zeppelin Solr Interpreter

  • Interpreter built with Apache Solr as backend and allows user to issue Solr queries and display results in the Zeppelin UI

Installation

  1. Download and untar Apache Zeppelin distribution if you don't have it already (Go lite or all)
  2. Install this interpreter via command
./bin/install-interpreter.sh --name solr --artifact com.lucidworks.zeppelin:zeppelin-solr:0.1.6

After running the above command

  1. Restart Zeppelin

  2. On the Interpreters page configure the 'solr' interpreter to point to a Solr base Url and default collection. Default JDBC parameters can also be set for use the with the "jdbc" Streaming Expression. The JDBC parameters will be automatically added to out-going jdbc calls if the jdbc Streaming Expression does not specify the connection parameters.

  3. Create a notebook with the default interpreter set to Solr.

Commands:

help

Display help text in the note window. Command-specific help is provided if a valid command is provided as an argument.

Usage: help {specific-command}

use

Set a collection to use in the notebook.

Usage: use {collection_name}

search

Issue a search query and have the results displayed as table, collection param can be passed in here avoiding use {collection_name}

Usage: search {query-params}

facet

Issue a query with facet fields and display the facet counts. No need to explicitly add facet=true for these queries, collection param can be passed in here avoiding use {collection_name}

Usage: facet {facet-params}

stream

Issue a streaming expression query and display the output as a table (No prefix required)

Usage: {stream-expr}

sql

Issue an Solr SQL query and display the results as a table (No prefix required)

Usage: {sql-string}

Troubleshooting

  • Check Solr interpreter log for any Solr errors (logs/zeppelin-interpreter-solr-*) (Fixed in 0.1.1)
  • Zeppelin 0.8.0 does not work well if interpreter does not have the same name as the interpreter installed. Not sure what is causing this. I would recommend using solr for interpreter name
  • If you have already installed a previous version of this interpreter, you will need to rename the ./interpreter/solr directory to allow the installer to run.

Example

screenshot

Setting up Intellij IDEA for this project

  1. clone the project to your local box
  2. Make sure scala plugin is enabled for IntelliJ
  3. In IntelliJ, click on 'File -> New -> Project from Existing Sources -> (Navigate to zeppelin-solr dir) -> select pom.xml -> click Open'
  4. Go through the steps for creating the project
  5. Overwrite .idea project if the IDE prompts
  6. Once deps are resolved, click on Build Project to verify