The Java Database Connection (JDBC) river allows to fetch data from JDBC sources for indexing into Elasticsearch.
It is implemented as an Elasticsearch plugin.
The relational data is internally transformed into structured JSON objects for the schema-less indexing model in Elasticsearch.
Creating a JDBC river is easy:
curl -XPUT 'localhost:9200/_river/my_jdbc_river/_meta' -d '{
"type" : "jdbc",
"jdbc" : {
"driver" : "com.mysql.jdbc.Driver",
"url" : "jdbc:mysql://localhost:3306/test",
"user" : "",
"password" : "",
"sql" : "select * from orders"
}
}'
Current version of the plugin: 2.0.2 (January 23, 2013)
Prerequisites:
Elasticsearch 0.20.x
JDBC driver jar
Bintray:
https://bintray.com/pkg/show/general/jprante/elasticsearch-plugins/elasticsearch-river-jdbc
Command:
./bin/plugin -url http://bit.ly/10FJhEd -install river-jdbc
RiverSource, RiverMouth, RiverFlow
Setting up the river with PostgreSQL
Elasticsearch JDBC River Plugin
Copyright (C) 2012,2013 Jörg Prante
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.