Watch Star Fork

白乔 / solr-sqlScalaBSD-3-Clause

Zhihong SHEN 最后提交于 2017-10-24 20:36 Update
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading... 1.96 KB

English Version:


solr-sql provides sql interfaces for solr cloud(, by which developers can operate on solr cloud via JDBC protocols.

On the same time, solr-sql is an Apache Calcite(see adapter for solr.

solr-sql is written in Scala, which generates JVM byte codes like Java.

So, if you are a Java developer, do not hesitate to choose solr-sql, because it is easy to be referenced by Java code. Also the test cases are written in Java(see

If you are interested in source codes, manybe you need install a ScalaIDE(, or scala plugins for eclipse.

solr-sql uses Maven to manage libary dependencies, it is a normal Maven project.

import solr-sql

use maven to import solr-sql:


JDBC client code

example code:

Properties info = new Properties();
info.setProperty("lex", "JAVA");
Connection connection = DriverManager.getConnection(
		"jdbc:calcite:model=src/java/test/model.json", info);

Statement statement = connection.createStatement();
String sql = "select * from docs where not (age>35 and name='bluejoe')";
ResultSet resultSet = statement.executeQuery(sql);

this illustrates how to connect to a solr 'database' in JDBC client manners, the schema of 'database' is defined in file 'src/java/test/model.json'.

run tests shows how to connect to a JDBC source of solr. tests if the translation from SQL filters to Solr filters is right, like:

Assert.assertEquals("age_i:{20 TO *}",
	trans("select * from docs where age>20"));

项目点评 ( 0 )


6_float_left_people 6_float_left_close