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
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
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.7.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. |
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