Script fields in nested query

Is there a way to run a "script_fields" adding fields to the returned inner_hits? Example:

{
   "nested": {
      "inner_hits": {},
      "path": "companies",
      "score_mode": "sum",
      "query": {},
      "script_fields": {
         "overlap" : {
            "script": {
               "source": "................................",
               "params": {
                   "from": "2012-01-01",
                    "to": "2015-06-30"
                }
            }
         }                
      }         
}

I execute n nested queries passing to each one a set of specific params. The idea is having the source script to assign a value to the overlap field for each one of the inner hits based on the provided params.

Any suggestion?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.