Solr JDBC - Apache Zeppelin

The Solr JDBC driver can support Apache Zeppelin.

This requires Apache Zeppelin 0.6.0 or greater which contains the JDBC interpreter.

To use Apache Zeppelin with Solr, you will need to create a JDBC interpreter for Solr. This will add SolrJ to the interpreter classpath. Once the interpreter has been created, you can create a notebook to issue queries. The Apache Zeppelin JDBC interpreter documentation provides additional information about JDBC prefixes and other features.

Create the Apache Solr JDBC Interpreter

image
Figure 1. Click "Interpreter" in the top navigation
image
Figure 2. Click "Create"
image
Figure 3. Enter information about your Solr installation

For most installations, Apache Zeppelin configures PostgreSQL as the JDBC interpreter default driver. The default driver can either be replaced by the Solr driver as outlined above or you can add a separate JDBC interpreter prefix as outlined in the Apache Zeppelin JDBC interpreter documentation.

Create a Notebook

image
Figure 4. Click Notebook -> Create new note
image
Figure 5. Provide a name and click "Create Note"

JDBC Interpreter Copy Sheet

To facilitate easy copying the parameters mentioned in the screenshots, here is a consolidated list of the parameters:

Name : Solr
Interpreter : jdbc
default.url : jdbc:solr://SOLR_ZK_CONNECTION_STRING?collection=
default.driver : org.apache.solr.client.solrj.io.sql.DriverImpl
default.user : solr
dependency : org.apache.solr:solr-solrj:7.3.0

Query with the Notebook

For some notebooks, the JDBC interpreter will not be bound to the notebook by default. Instructions on how to bind the JDBC interpreter to a notebook are available here.

image
Figure 6. Results of Solr query

The below code block assumes that the Apache Solr driver is setup as the default JDBC interpreter driver. If that is not the case, instructions for using a different prefix is available here.

%jdbc
select fielda, fieldb, from test limit 10
Comments on this Page

We welcome feedback on Solr documentation. However, we cannot provide application support via comments. If you need help, please send a message to the Solr User mailing list.