Hi,
So I have this query which works perfectly as a mustache script in ElasticSearch 1.7.
{
"_source": [
"rootRecord.openedDate",
"rootRecord.typeName",
"rootRecord.dataFields.Short Desc.",
"rootRecord.canceled"
],
"sort": [
"rootRecord.typeName",
"rootRecord.openedDate"
],
"size" : 1000,
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"and": {
"filters": [
{
"range": {
"rootRecord.openedDate": {
"from": "{{from}}"
}
}
},
{
"bool": {
"must": {
"term": {
"rootRecord.canceled": "false"
}
}
}
}
]
}
}
}
},
"aggs": {
"openedMonth": {
"date_histogram": {
"field": "rootRecord.openedDate",
"interval": "month"
},
"aggs": {
"byType": {
"terms": {
"field": "_type"
}
}
}
}
}
}
I know there's quite a few things to remove, such as _source, sort, size, based on the errors received. However even after removing those, I get errors complaining that "rootRecord.openedDate" is not valid, since it has a . in the path. In addition, I get an unknown field on aggs. This is all even though I have valid mappings for these fields.
"properties": {
"rootRecord": {
"type": "object",
"properties": {
"closedDate": {
"type": "date"
},
"openedDate": {
"type": "date"
},
"canceled": {
"type": "boolean"
},
"typeName": {
"type": "string"
},
So I was wondering if I was doing something wrong? Or is there something I'm missing?
John