lucidworks / zeppelin-solr

Apache Solr interpreter for Apache Zeppelin
Apache License 2.0
28 stars 4 forks source link

Zeppelin Solr Interpreter

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

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