1
我執行這個查詢:獲得彈性的搜索查詢無效號碼特殊
{
"query" : {
"match" : {
"studyID" : {
"query" : 1,
"type" : "boolean"
}
}
},
"aggregations" : {
"25-34" : {
"date_range" : {
"field" : "timestamp",
"ranges" : [ {
"from" : "1992",
"to" : "1983"
} ],
"format" : "yyyy"
},
"aggregations" : {
"activityType" : {
"terms" : {
"field" : "activityType"
}
}
}
},
"84-*" : {
"date_range" : {
"field" : "timestamp",
"ranges" : [ {
"from" : "1933"
} ],
"format" : "yyyy"
},
"aggregations" : {
"activityType" : {
"terms" : {
"field" : "activityType"
}
}
}
},
"18-24" : {
"date_range" : {
"field" : "timestamp",
"ranges" : [ {
"from" : "1999",
"to" : "1993"
} ],
"format" : "yyyy"
},
"aggregations" : {
"activityType" : {
"terms" : {
"field" : "activityType"
}
}
}
},
"75-84" : {
"date_range" : {
"field" : "timestamp",
"ranges" : [ {
"from" : "1942",
"to" : "1933"
} ],
"format" : "yyyy"
},
"aggregations" : {
"activityType" : {
"terms" : {
"field" : "activityType"
}
}
}
},
"0-17" : {
"date_range" : {
"field" : "timestamp",
"ranges" : [ {
"from" : "2017",
"to" : "2000"
} ],
"format" : "yyyy"
},
"aggregations" : {
"activityType" : {
"terms" : {
"field" : "activityType"
}
}
}
},
"55-64" : {
"date_range" : {
"field" : "timestamp",
"ranges" : [ {
"from" : "1962",
"to" : "1953"
} ],
"format" : "yyyy"
},
"aggregations" : {
"activityType" : {
"terms" : {
"field" : "activityType"
}
}
}
},
"65-74" : {
"date_range" : {
"field" : "timestamp",
"ranges" : [ {
"from" : "1952",
"to" : "1943"
} ],
"format" : "yyyy"
},
"aggregations" : {
"activityType" : {
"terms" : {
"field" : "activityType"
}
}
}
},
"35-44" : {
"date_range" : {
"field" : "timestamp",
"ranges" : [ {
"from" : "1982",
"to" : "1973"
} ],
"format" : "yyyy"
},
"aggregations" : {
"activityType" : {
"terms" : {
"field" : "activityType"
}
}
}
},
"45-54" : {
"date_range" : {
"field" : "timestamp",
"ranges" : [ {
"from" : "1972",
"to" : "1963"
} ],
"format" : "yyyy"
},
"aggregations" : {
"activityType" : {
"terms" : {
"field" : "activityType"
}
}
}
}
}
}
在那裏我只是想根據日期範圍,以聚集活性,然後子聚集按活動類型,但彈性搜索的範圍是給我這個例外:
{
"error": {
"root_cause": [
{
"type": "aggregation_execution_exception",
"reason": "Invalid number format [yyyy#]"
}
],
"type": "search_phase_execution_exception",
"reason": "all shards failed",
"phase": "query",
"grouped": true,
"failed_shards": [
{
"shard": 0,
"index": "study",
"node": "MWkXAAOCSYuM-ubdkulNnw",
"reason": {
"type": "aggregation_execution_exception",
"reason": "Invalid number format [yyyy#]"
}
}
]
},
"status": 500
}
任何想法我錯過了什麼?
這是什麼運氣? – Val