[英]How do I extract the "message" value from elasticsearch? (DSL)
How do I extract the "message" value from elasticsearch?如何从 elasticsearch 中提取“消息”值? (DSL) (DSL)
I tried it.我尝试过这个。 (my code) (我的代码)
-> I want to extract all the "message" values only. -> 我只想提取所有“消息”值。
GET 0503instgram_csv/_search
{
"query" : {
"query_string": {
"default_field": "message",
"query": ?????????????
}
}
}
-> I want to process the data by saving new field values of all "message" that are printed out. -> 我想通过保存打印出的所有“消息”的新字段值来处理数据。
I'd really appreciate your help.我真的很感谢你的帮助。
@ESCoder This is a picture of the result of the attempt as you said. @ESCoder 这是您所说的尝试结果的图片。
{
"took" : 1,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 281,
"relation" : "eq"
},
"max_score" : 1.0,
"hits" : [
{
"_index" : "0503instgram_csv",
"_type" : "_doc",
"_id" : "zbKQMXkB98wUkKJOL8dT",
"_score" : 1.0,
"_source" : {
"message" : "\"lovablepoetree"
}
},
{
"_index" : "0503instgram_csv",
"_type" : "_doc",
"_id" : "zrKQMXkB98wUkKJOL8dU",
"_score" : 1.0,
"_source" : {
"message" : """내가 아는 사람 중에 최고 셀럽(@hanstar.kim)과 맥주 마심🍻셀럽과 술이라니....! 성공해따 나자신!!!!!! 그래놓고 사진은 나 혼자 찍어따^.^ 다음번엔 투샷을 찍어보쟈......🥰"""
}
},
{
"_index" : "0503instgram_csv",
"_type" : "_doc",
"_id" : "z7KQMXkB98wUkKJOL8dU",
"_score" : 1.0,
"_source" : {
"message" : """🔥🔥..열정을 응원 합니다. 도대현 드림❤️❤️❤️"""
}
},
{
"_index" : "0503instgram_csv",
"_type" : "_doc",
"_id" : "0LKQMXkB98wUkKJOL8dU",
"_score" : 1.0,
"_source" : {
"message" : "lovablepoetree"
}
},
{
"_index" : "0503instgram_csv",
"_type" : "_doc",
"_id" : "0bKQMXkB98wUkKJOL8dj",
"_score" : 1.0,
"_source" : {
"message" : """좋아요 69개
"""
}
},
{
"_index" : "0503instgram_csv",
"_type" : "_doc",
"_id" : "0rKQMXkB98wUkKJOL8dj",
"_score" : 1.0,
"_source" : {
"message" : """['paulchang1103,Paul Chang (장준성)🇰🇷,passionated_man,도대현,luv_____juju,쥬쥬,koonge01,영이,p.s.j___5959,또둔,panchitoyoon,Ye Suk Yoon,hyeriiing__,혤,sunny.gibbab,써니네식탁(sunny Gib-bab),_wjstn_ry_02,전수교(20),sungwoon_jinsik,윤성운🇰🇷,t_a_k_3014,🎀케이,팔로우']
"""
}
},
{
"_index" : "0503instgram_csv",
"_type" : "_doc",
"_id" : "07KQMXkB98wUkKJOL8dj",
"_score" : 1.0,
"_source" : {
"message" : "passionated_man"
}
},
{
"_index" : "0503instgram_csv",
"_type" : "_doc",
"_id" : "1LKQMXkB98wUkKJOL8dj",
"_score" : 1.0,
"_source" : {
"message" : "1일"
}
},
{
"_index" : "0503instgram_csv",
"_type" : "_doc",
"_id" : "1bKQMXkB98wUkKJOL8dj",
"_score" : 1.0,
"_source" : {
"message" : """🔥🔥..열정을 응원 합니다. 도대현 드림❤️❤️❤️"""
}
},
{
"_index" : "0503instgram_csv",
"_type" : "_doc",
"_id" : "1rKQMXkB98wUkKJOL8dj",
"_score" : 1.0,
"_source" : {
"message" : """1일답글 달기","lovablepoetree"""
}
}
]
}
}
You can do source filtering to extract only message
field values您可以进行源过滤以仅提取message
字段值
GET/_search
{
"_source": [
"message"
]
}
Update 1:更新1:
You can use the reindex API , to store only the field values of the message
field in a different index您可以使用重新索引 API ,仅将message
字段的字段值存储在不同的索引中
POST /_reindex
{
"source": {
"index": "old-index",
"_source": ["message"]
},
"dest": {
"index": "new-index"
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.