Last active
December 26, 2015 19:49
JDBC river from MySql to ElasticSearch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PUT /_river/jdbc_river_1/_meta | |
{ | |
"type" : "jdbc", | |
"jdbc" : { | |
"url": "jdbc:mysql://localhost:3306/yourDb", | |
"user": "login", | |
"password": "pass", | |
"sql" : "SELECT * FROM Transactions WHERE user_id = 1", | |
"index" : "my_jdbc_index", | |
"type" : "my_jdbc_type", | |
"bulk_size": 5000, | |
"max_bulk_requests": 30, | |
"type_mapping": { | |
"my_jdbc_type": { | |
"properties": { | |
"myInvoicePrice": {"type": "double"}, | |
"customer": {"type": "string","store": true,"index": "not_analyzed"}, | |
"created": {"type": "date","store": true}, | |
"dataset_id": {"type": "long"} | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment