已有 MySQL 很多数据表,现在需要对其中一部分做全文索引。如何设置 JDBC river 指定同步的数据?最好能精确到字段。
看SQL怎么写了
"jdbc": {
"driver": "com.mysql.jdbc.Driver",
"url": "jdbc:mysql://localhost:3306/profile",
"user": "root",
"password": "root",
"sql": "select id as _id,name,login_name from user",
"index": "profile",
"type": "user",
"bulk_size": 100,
"max_bulk_requests": 30,
"bulk_timeout": "10s",
"flush_interval": "5s",
"schedule": "0 0-59 0-23 ? * *"
}
update
sql不能满足需求的那就自己写同步脚本。增量同步、索引重建啊啥的。用python好点吧。时间戳或id做增量同步,用alias来进行索引重建设置一个新索引,建立完全索引,设置alias指向新索引,删除旧索引
。