about ElasticSearch jdbc river

elasticsearch, elasticsearch-jdbc-river

Solution

You did not define an _id so the river add your documents every minutes.

You should define your river with something like:

curl -XPUT 'localhost:9201/_river/my_jdbc_river/_meta' -d '{
    "type" : "jdbc",
    "jdbc" : {
        "driver" : "com.mysql.jdbc.Driver",
        "url" : "jdbc:mysql://localhost:3301/test",
        "user" : "root",
        "password" : "root",
    "poll" : "10s",
    "strategy" : "simple",
        "sql" : "select id as _id, name from cc"
    }
}'

See JDBC River documentation for details.

Problem

In my MySQL: ``` mysql> select * from cc; +----+------+ | id | name | +----+------+ | 1 | aa | | 2 | bb | +----+------+ 2 rows in set (0.00 sec) ``` and elasticsearch jdbc river is: ``` curl -XPUT 'localhost:9201/_river/my_jdbc_river/_meta' -d '{ "type" : "jdbc", "jdbc" : { "driver" : "com.mysql.jdbc.Driver", "url" : "jdbc:mysql://localhost:3301/test", "user" : "root", "password" : "root", "poll" : "10s", "strategy" : "simple", "sql" : "select * from cc" } }' ``` but,I don't understand elasticsearch index data why result is: ``` aa bb aa bb aa aa aa bb bb bb ``` I think result like this: ``` aa bb ``` please help me, and thanks gsc-leticia help me format this question content.

Original source