Select only one element inside an object

Let's say I have an object with N fields, and I only want to return one of them. How can I do that? Can I exclude the whole object and then include one of their childs?


You says something like that:

  "name" : "xpto",
          "address" : {
            "number" : 15,
            "street" : "street b"


GET idx_teste_nested/_search
  "_source": ["address.number"], 
  "query": {
    "match_all": {}

Response (only address.number)

        "_index" : "idx_teste_nested",
        "_type" : "_doc",
        "_id" : "WhTFioABHFVsAeBmboN8",
        "_score" : 1.0,
        "_source" : {
          "address" : {
            "number" : 15

Well, I would like to return all other results as well, like name or other fields (I start with a wildcard)

give a example for explain better

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