JDBC with SQuirreL SQL

Solr’s JDBC driver supports SQuirreL SQL.

To configure this, you will need to create a new driver for Solr. This will add several SolrJ client .jars to the SQuirreL SQL classpath. The files required are:

  • SolrJ dependency .jar s found in $SOLR_TIP/server/solr-webapp/webapp/WEB-INF/lib/* and $SOLR_TIP/server/lib/ext/*. In the Solr distribution these dependencies are not separated from Solr’s dependencies, so you must include all or manually choose the exact set that is needed. Please refer to the maven release for the exact dependencies needed for your version.

  • The SolrJ .jar found at $SOLR_TIP/server/solr-webapp/webapp/WEB-INF/lib/solr-solrj-<version>.jar

Once the driver has been created, you can create a connection to Solr with the connection string format outlined in the generic section and use the editor to issue queries.

Add Solr JDBC Driver

Open Drivers

image

Add Driver

image

Name the Driver

Provide a name for the driver, and provide the URL format: jdbc:solr://<zk_connection_string>/?collection=<collection>. Do not fill in values for the variables “zk_connection_string” and “collection”, those will be defined later when the connection to Solr is configured.

image

Add Solr JDBC jars to Classpath

image
image
image
image

Add the Solr JDBC driver class name

After adding the .jars, you will need to additionally define the Class Name org.apache.solr.client.solrj.io.sql.DriverImpl.

image

Create an Alias

To define a JDBC connection, you must define an alias.

Open Aliases

image

Add an Alias

image

Configure the Alias

image

Connect to the Alias

image

Querying

Once you’ve successfully connected to Solr, you can use the SQL interface to enter queries and work with data.

image