0

I am having weird issue

http://  machinename:9200/1_exposureindex/riskitemsearch/_search/

    {
  "query": {
    "has_parent": {
      "parent_type": "contractsearch",
      "query": {
        "term": {
          "Name": "4l4"
        }
      }
    }
  }
}

when I execute this query I get null pointer exception

{
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
}

but same query works when I do has_child

e.g. 
http://   machinename:9200/1_exposureindex/contractsearch/_search/

    {
  "query": {
    "has_child": {
      "type": "riskitemsearch",
      "query": {
        "term": {
          "Name": "4l4"
        }
      }
    }
  }
}
1
  • Can you post a complete curl recreation with also a few documents that you indexed to reproduce the problem?
    – javanna
    Oct 23, 2013 at 8:10

1 Answer 1

0

I figured out the issue, it was mapping issue. I had _parent set to InitCase where as actual parent is lowercase.

Regards, VB

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.