我试图实现这个多搜索请求的感觉和插件头,但我无法得到什么可能的问题?文档上的样品是卷曲的,我不明白确切的区别是什么。
POST _msearch?pretty=1
{"myIndex":"Product"}
{
"fields": [
"id",
"Name"
],
"query": {
"bool": {
"should": [
{
"query_string": {
"default_field": "_all",
"query": "key"
}
}
]
}
}
,
"from": 0,
"size": 5,
"sort": [],
"aggs": {}
}
{"myIndex":"Printer"}{
"fields": [
"id",
"Name"
],
"query": {
"bool": {
"must": [{
"has_child": {
"type": "Printer",
"query": {
"match": {
"Name": "key"
}
}
}
}]
}
}
,
"from": 0,
"size": 5,
"sort": [],
"aggs": {}
}
我在理智上搞错了。{“错误”:“JsonParseException[意外结束输入:对象的预期结束标记”(来自[来源: B@48acbc4c;行: 1,列: 0)\n在[来源: B@48acbc4c;行: 1,列: 3]“状态”:500 }
发布于 2016-02-15 13:43:44
这是因为额外的空间。通过删除额外的空格和下一行,我删除了这个错误。在某种意义上,运行两次ctrl+I
以先缩进查询,然后取消缩进查询。
希望这能消除错误。
https://stackoverflow.com/questions/35408907
复制相似问题