gpt4 book ai didi

elasticsearch - 如何在Elasticsearch中索引Twitter数据?

转载 作者:行者123 更新时间:2023-12-03 00:55:33 29 4
gpt4 key购买 nike

我已经使用流式API从Twitter上获取了一些数据。该文件具有与数据相对应的json行。我想在Elasticsearch中索引此数据,以便可以轻松地对其进行搜索。

我使用以下命令进行索引

cat file.json | jq -c '.[] | {"index": {"_index": "bookmarks", "_type": "bookmark", "_id": .id}}, .' | curl -XPOST localhost:9200/_bulk --data-binary @-

但它导致以下错误。
jq: error (at <stdin>:127687): Cannot index string with string "id"

最佳答案

无需手动完成所有操作,您只需使用Logstash Twitter Input。

我为此写了一个blog post

关于elasticsearch - 如何在Elasticsearch中索引Twitter数据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44917934/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com