How to create ES index with a mapping and data from Mysql ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

How to create ES index with a mapping and data from Mysql ?

dark_shadow
Hi,

I'm using ES for creating an index with a mapping and data from Mysql. I'm able to create an empty idex along with mappings and settings but I'm not able to import data from Mysql into that index. I'm using https://github.com/jprante/elasticsearch-river-jdbc this plugin with ES 1.1.0 There is no problem in version. The example shows something like this:

curl -XPUT 'localhost:9200/_river/my_jdbc_river/_meta' -d '{
    "type" : "jdbc",
    "jdbc" : {
        "url" : "jdbc:mysql://localhost:3306/test",
        "user" : "",
        "password" : "",
        "sql" : "select * from orders"
    }
}'

But how can I change it for some index INDEX and type TYPE.

curl -XPUT "localhost:9200/_river/INDEX/_meta" -d '
{
"type": "jdbc",
"jdbc": {
"url": "jdbc:mysql://localhost:3306/my_db",
"driver": "com.mysql.jdbc.Driver",
"user" : "root",
"password": "root",
"sql" : "select * from my_table"
},
"index": {
"index" : "INDEX",
"type" : "TYPE"
}
}'

But this is not working for me ?

Please help me.

Thanks

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/209f2dc4-d566-44d8-8413-079578a1d4ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.