Return only the data inside nested property

Currently i have this mapping.

{
  "blogs": {
    "mappings": {
      "blog": {
        "properties": {
          "comments": {
            "properties": {
              "content": {
                "type": "nested",
                "properties": {
                  "date": {
                    "type": "date"
                  },
                  "id": {
                    "type": "long"
                  },
                  "message": {
                    "type": "text"
                  },
                  "rating": {
                    "type": "long"
                  }
                }
              }
            }
          },
          "id": {
            "type": "long"
          },
          "tags": {
            "properties": {
              "content": {
                "type": "nested",
                "properties": {
                  "tag": {
                    "type": "text",
                    "fields": {
                      "keyword": {
                        "type": "keyword",
                        "ignore_above": 256
                      }
                    }
                  }
                }
              }
            }
          },
          "title": {
            "type": "text"
          }
        }
      }
    }
  }
}

Is possible just return the entries in nested property 'comments' when the blog.id (father) is greater than 10 and comments.content.rating (nested) is equal to 5 and return the 'father' of 'comments' and use sum aggregation for the property comments.content.rating (with the equivalent search condition)?

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