Elasticsearch _source include a specific array item from the document

My document looks like this

{
            "_index": "mydb",
            "_type": "target",
            "_id": "AV8vO5O0eCTee14x6VZQ",
            "_score": 1,
            "_source": {
               "line": "77.001",
               "parameters": [
                  {
                     "parameterType": "Lift",
                     "coefficients": [
                        {
                           "name": "Margin"
                        },
                        {
                           "name": "Sales"
                        }
                     ]
                  },
                  {
                     "parameterType": "Display",
                     "coefficients": [
                        {
                           "name": "Front"
                        },
                        {
                           "name": "Back"
                        }
                     ]
                  }
               ]
            }
         }

In my search response i need to include one particular coefficients for a particular parameterType.
For example i want Margin for Lift & Back for Display

Question is how to i write my request? Eventually i need to write it in NEST code.

request:

post mydb/target/_search
{
    "_source":{
        "include": [/*What should i write here?*/]
    }
}

response:

{
            "_index": "mydb",
            "_type": "target",
            "_id": "AV8vO5O0eCTee14x6VZQ",
            "_score": 1,
            "_source": {
               "line": "77.001",
               "parameters": [
                  {
                     "parameterType": "Lift",
                     "coefficients": [
                        {
                           "name": "Margin"
                        }
                     ]
                  },
                  {
                     "parameterType": "Display",
                     "coefficients": [
                        {
                           "name": "Back"
                        }
                     ]
                  }
               ]
            }
         }

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