11.05.2016 Views

Apache Solr Reference Guide Covering Apache Solr 6.0

21SiXmO

21SiXmO

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

expr=search(collection1,<br />

zkHost="localhost:9983",<br />

qt="/export",<br />

q="*:*",<br />

fl="id,a_s,a_i,a_f",<br />

sort="a_f asc, a_i asc")<br />

jdbc<br />

The jdbc function searches a JDBC datasource and emits a stream of tuples representing the JDBC result set.<br />

Each row in the result set is translated into a Tuple and each Tuple contains all the cell values for that row.<br />

Parameters<br />

connection: (Mandatory) JDBC formatted connection string to whatever driver you are using.<br />

sql: (Mandatory) query to pass off to the JDBC endpoint<br />

sort: (Mandatory) The sort criteria indicating how the data coming out of the JDBC stream is sorted<br />

driver: The name of the JDBC driver used for the connection. If provided then the driver class will<br />

attempt to be loaded into the JVM. If not provided then it is assumed that the driver is already loaded into<br />

the JVM. Some drivers require explicit loading so this option is provided.<br />

[driverProperty]: One or more properties to pass to the JDBC driver during connection. The format is<br />

propertyName="propertyValue". You can provide as many of these properties as you'd like and<br />

they will all be passed to the connection.<br />

Connections and Drivers<br />

Because some JDBC drivers require explicit loading the driver parameter can be used to provide the driver<br />

class name. If provided, then during stream construction the driver will be loaded. If the driver cannot be loaded<br />

because the class is not found on the classpath, then stream construction will fail.<br />

When the JDBC stream is opened it will validate that a driver can be found for the provided connection string. If a<br />

driver cannot be found (because it hasn't been loaded) then the open will fail.<br />

Datatypes<br />

Due to the inherent differences in datatypes across JDBC sources the following datatypes are supported. The<br />

table indicates what Java type will be used for a given JDBC type. Types marked as requiring conversion will go<br />

through a conversion for each value of that type. For performance reasons the cell data types are only<br />

considered when the stream is opened as this is when the converters are created.<br />

JDBC Type Java Type Requires Conversion<br />

String String No<br />

Short Long Yes<br />

Integer Long Yes<br />

Long Long No<br />

Float Double Yes<br />

Double Double No<br />

Boolean Boolean No<br />

<strong>Apache</strong> <strong>Solr</strong> <strong>Reference</strong> <strong>Guide</strong> <strong>6.0</strong><br />

409

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!