我遇到了奇怪的问题
http:// machinename:9200/1_exposureindex/riskitemsearch/_search/
{
"query": {
"has_parent": {
"parent_type": "contractsearch",
"query": {
"term": {
"Name": "4l4"
}
}
}
}
}
当我执行此查询时,我得到空指针异常
{
error: SearchPhaseExecutionException[Failed to execute phase [query], total failure; shardFailures {[zohpYnUKQNSpROOg6eER9Q][1_exposureindex][1]: SearchParseException[[1_exposureindex][1]: from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"has_parent":{"parent_type":"contractsearch","query":{"term":{"Name":"4l4"}}}}}]]]; nested: NullPointerException; }{[zohpYnUKQNSpROOg6eER9Q][1_exposureindex][0]: SearchParseException[[1_exposureindex][0]: from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"has_parent":{"parent_type":"contractsearch","query":{"term":{"Name":"4l4"}}}}}]]]; nested: NullPointerException; }]
status: 500
}
但是当我执行has_child
时,同样的查询有效e.g.
http:// machinename:9200/1_exposureindex/contractsearch/_search/
{
"query": {
"has_child": {
"type": "riskitemsearch",
"query": {
"term": {
"Name": "4l4"
}
}
}
}
}
答案 0 :(得分:0)
我想出了问题,这是映射问题。我将_parent设置为InitCase,其中实际父级为小写。
此致 VB