0
不支持話說日期格式,我不能與日期格式彈性搜索來搜索彈性檢索失敗,在指數
我創建的索引和字段映射出的日期格式,但查詢失敗。
在加載數據之前,我使用映射創建了一個索引,並將我的數據加載到彈性搜索中。
"mappings": {
"workers": {
"person.birthDate": {
"full_name": "person.birthDate",
"mapping": {
"birthDate": {
"type": "date",
"format": "yyyy-MM-dd||epoch_millis"
}
}
}
我輸入的查詢是如下
POST _search
{
"query": {
"bool" : {
"must" : [ {
"match" : {
"person.birthDate" : {
"query" : "1968-06-15",
"type" : "date"
}
}
} ]
}
},
"from": 0,
"size": 10,
"sort": [],
"aggs": {}
}
和輸出
{
"error": {
"root_cause": [
{
"type": "query_parsing_exception",
"reason": "[match] query does not support type date",
"index": "index1",
"line": 9,
"col": 33
}
],
"type": "search_phase_execution_exception",
"reason": "all shards failed",
"phase": "query",
"grouped": true,
"failed_shards": [
{
"shard": 0,
"index": "index1",
"node": "RewaFar_TsGVGz1RmgOxlA",
"reason": {
"type": "query_parsing_exception",
"reason": "[match] query does not support type date",
"index": "index1",
"line": 9,
"col": 33
}
}
]
},
"status": 400
}
任何幫助,在此,將不勝感激。 請注意,我對彈性搜索很陌生。
這worked.thanks爲help.meant爲接受的答案後期更新而回SRY。 – Fryder