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

Fetching changes from table with ElasticSearch JDBC river(使用 ElasticSearch JDBC River 从表中获取更改)
本文介绍了使用 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 从表中获取更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Hibernate reactive No Vert.x context active in aws rds(AWS RDS中的休眠反应性非Vert.x上下文处于活动状态)
Bulk insert with mysql2 and NodeJs throws 500(使用mysql2和NodeJS的大容量插入抛出500)
Flask + PyMySQL giving error no attribute #39;settimeout#39;(FlASK+PyMySQL给出错误,没有属性#39;setTimeout#39;)
auto_increment column for a group of rows?(一组行的AUTO_INCREMENT列?)
Sort by ID DESC(按ID代码排序)
SQL/MySQL: split a quantity value into multiple rows by date(SQL/MySQL:按日期将数量值拆分为多行)