使用 ElasticSearch JDBC River 从表中获取更改

我正在为 ElasticSearch 配置 JDBC River,但我找不到任何好的配置示例.我已阅读 pages 上的所有 elasticsearch-river-jdbc GitHub.

I'm configuring JDBC river for ElasticSearch but I can't find any good config example. I've read all pages on elasticsearch-river-jdbc GitHub.

我有一个 SQL 查询,我需要每隔 X 秒从所有表列中获取更改.如何告诉 JDBC River 某行已更改并应重新编制索引?

I have a SQL query and I need to fetch changes from all table columns every X seconds. How can I tell JDBC river that some row is changed and should be reindexed?

在 ES 服务器启动期间获取数据,正在进行轮询,但不会将更改从 DB 获取到 ES.

Data are fetched during ES server start, polling is happening, but changes are not fetched from DB to ES.

我的配置:

curl -XPUT 'localhost:9200/_river/itemsi/_meta' -d '{
"type" : "jdbc",
"jdbc" : {
    "driver" : "com.mysql.jdbc.Driver",
    "url" : "jdbc:mysql://mydb.com:3306/dbname",
    "user" : "yyy",
    "password" : "xxx",
    "sql" : "SELECT ii.id AS _id, ii.id AS myid, ... FROM ... LEFT JOIN .. ON...",
    "poll" : "6s",
    "strategy" : "simple"
    },
"index" : {
    "index" : "invoiceitems",
    "bulk_size" : 600,
    "max_bulk_requests" : 10,
    "bulk_timeout" : "5s",
    }
}'

谢谢.

推荐答案

添加

自动提交":真

在索引设置中.那么问题就解决了

in index settings. Then the problem will be resolved

相关文章