0
嘗試使用範圍查詢執行'精確'日期匹配,但沒有成功。 我agreement_start_date
場下面映射彈性搜索日期的確切範圍
"agreement_start_date" : {
"type" : "date",
"format" : "strict_date_optional_time||epoch_millis"
}
我已經索引單個文檔,它似乎被索引的罰款。
curl "localhost:9200/cr/_search?pretty=true" -d ''
{
"took" : 35,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 1,
"max_score" : 1.0,
"hits" : [ {
"_index" : "cr",
"_type" : "agreement_index",
"_id" : "570fe59b7f9e6f7f762129ed",
"_score" : 1.0,
"_source":{"agreement_start_date": "2016-04-14T18:46:51.268176+00:00"}
}
}
我想獲得與記錄匹配agreement_start_date
與特定日期的簡單查詢此記錄。
{
"query": {
"bool": {
"must": {
"range": {
"agreement_start_date": {
"gte": "2016-04-14",
"lte": "2016-04-14",
"format": "yyyy-MM-dd"
}
}
}
}
}
}
此查詢返回0結果。如何在僅比較日期提供的部分進行彈性搜索時進行查詢?