【发布时间】:2017-09-27 16:47:31
【问题描述】:
我通过elasticsearch创建了一个表并同步到cassandra:
_id | message | postDate | user
-----+--------------------------------------------+-------------------------------------+------------
2 | ['Another tweet, will it be indexed?'] | ['2009-11-15 14:12:12.000000+0000'] | ['kimchy']
1 | ['Trying out Elassandra, so far so good?'] | ['2009-11-15 13:12:00.000000+0000'] | ['kimchy']
当我更改表格推文并添加电子邮件列时:
ALTER TABLE tweet ADD email varchar;
```
_id | email | message | postDate | user
-----+-------+--------------------------------------------+-------------------------------------+------------
2 | null | ['Another tweet, will it be indexed?'] | ['2009-11-15 14:12:12.000000+0000'] | ['kimchy']
1 | null | ['Trying out Elassandra, so far so good?'] | ['2009-11-15 13:12:00.000000+0000'] | ['kimchy']
``` 电子邮件已添加,但显示为 null。
但是当我在 elasticsearch 上查询时它不同步:
{
"took" : 4,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"hits" : {
"total" : 2,
"max_score" : 1.0,
"hits" : [ {
"_index" : "twitter",
"_type" : "tweet",
"_id" : "2",
"_score" : 1.0,
"_source":{"postDate":"2009-11-15T14:12:12.000Z","message":"Another tweet, will it be indexed?","user":"kimchy"}
}, {
"_index" : "twitter",
"_type" : "tweet",
"_id" : "1",
"_score" : 1.0,
"_source":{"postDate":"2009-11-15T13:12:00.000Z","message":"Trying out Elassandra, so far so good?","user":"kimchy"}
} ]
}
}
问题是我如何才能将表的更改从 cassandra 同步到 elasticsearch?
【问题讨论】:
-
你用什么来同步数据..