我正在处理kibana
和elasticsearch
。我在elasticsearch
中索引了文档。现在,我想创建一个用户界面并使其可以像这样搜索:
GET /complete_index/_search
{
"query":
{
"multi_match": {
"query": "broker connection",
"operator":"and",
"fields": ["post_subject","topic_title"]
}
},
"from": 0,
"size": 50,
"_source": ["post_id","topic_id","post_subject","topic_title"]
}

我无法将elasticsearch
查询作为数据传递给休息调用。我该如何纠正?
答案 0 :(得分:0)
使用curl请求对Elasticsearch进行休息调用,如下所示。
curl -XGET "https://f03cadb8fd043aa17dcce6850f4646e7.ap-southeast-1.aws.found.io:9243/complete_index/_search" -H 'Content-Type: application/json' -d'
{"query":{"multi_match":{"query":"broker connection","operator":"and","fields":["post_subject","topic_title"]}},"from":0,"size":50,"_source":["post_id","topic_id","post_subject","topic_title"]}'