我有映射:
"mappings": {
"productsearchmodel": {
"properties": {
"id": {
"type": "integer"
},
"properties": {
"properties": {
"invariant": {
"properties": {
"Name": {
"analyzer": "Replace",
"boost": 40,
"type": "string"
},
"Description": {
"analyzer": "Replace",
"boost": 40,
"type": "string"
}
},
"type": "nested"
},
},
"type": "nested"
}
}
}
我的查询是:
{
"query": {
"bool": {
"should": [
{
"nested": {
"path": "properties.invariant",
"query": {
"query_string": {
"query": "Bal",
"fields": [
"Description"
]
}
}
}
}
]
}
}
}
但结果是:
{
"took": 5,
"timed_out": false,
"_shards": {
"total": 2,
"successful": 1,
"failed": 1,
"failures": [
{
"index": "pagesearchmodel",
"shard": 0,
"status": 400,
"reason": "RemoteTransportException[[Powerpax][inet[/192.168.0.57:9300]][indices:data/read/search[phase/query]]]; nested: SearchParseException[[pagesearchmodel][0]: from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"bool":{"should":[{"nested":{"path":"properties.invariant","query":{"query_string":{"query":"Bal","fields":["Description"]}}}}]}}}]]]; nested: QueryParsingException[[pagesearchmodel] [nested] failed to find nested object under path [properties.invariant]]; "
}
]
},
"hits": {
"total": 0,
"max_score": null,
"hits": [ ]
}
}
答案 0 :(得分:1)
我没有在我的请求网址中指定索引,搜索尝试在所有具有不同结构的indexex上执行。