Hi all,

I'm using ES 1.3.2
My document structure

                {
                   "mapids" : [mapid1, mapid2,mapid3],
                   "rdata" : [ {mapid1: value1}, 
{mapid2:value2},{mapid3:value3} ]
                 }

We are trying to migrate to the new aggregation framework and I'm trying to 
rewrite terms facet which was 

{
  "query": {
    "filtered": {
      "filter": {
        "bool": {
          "must": [
            {
              "terms": {
                "mapids": [
                  0,
                  77188
                ],
                "execution": "and"
              }
            }
          ]
        }
      }
    }
  },
  "facets": {
    "facet1": {
      "terms": {
        "field": "value"
      },
      "nested": "rdata",
      "facet_filter": {
        "term": {
          "mapid": "77188"
        }
      }
    }
  }
}

Which comes back with the buckets


   - terms: [
      - {
         - term: 10
         - count: 257998
      }
      - ...
      - ....
      - {
         - term: 4
         - count: 28477
      }
   ]

I was trying to rewrite the same query using the aggregation framework but 
it comes back Parse Failure [Found two aggregation type definitions in 
[rdata]: [filter] and [nested]]]

{
  "query": {
    "filtered": {
      "filter": {
        "bool": {
          "must": [
            {
              "terms": {
                "mapids": [
                  0,
                  77188,
                  77200
                ],
                "execution": "and"
              }
            }
          ]
        }
      }
    }
  },
  "aggs": {
    "rdata": {
      "filter": {
        "term": {
          "mapid": "77188"
        }
      },
      "nested": {
        "path": "rdata"
      },
      "aggs": {
        "rdata_value": {
          "terms": {
            "field": "value"
          }
        }
      }
    }
  }
}

Any help is appreciated
Thanks,
Abhishek


-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/b7cc4b9b-7767-46b9-a8ab-ff4159b5f502%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to