我有奇怪的问题
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"
}
}
}
}
}