使用 ElasticSearch JDBC River 从表中获取更改 [英] Fetching changes from table with ElasticSearch JDBC river

查看:37
本文介绍了使用 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

这篇关于使用 ElasticSearch JDBC River 从表中获取更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆