複数のフィールド、または のような接尾辞を持つフィールドに対して範囲クエリを実行したいと考えていますmarkups.*
。Nest
またはでこれを行う方法はないようですElasticsearch
。たとえば、ES の次のクエリは結果を返します。
{
"query": {
"range": {
"markups.1": {
"gte": "2015-01-01T00:00:00.000",
"lte": "2015-05-20T10:49:07.608"
}
}
}
}
しかし、この接尾辞付きのクエリは何も返しません。
{
"query": {
"range": {
"markups.*": {
"gte": "2015-01-01T00:00:00.000",
"lte": "2015-05-20T10:49:07.608"
}
}
}
}
EDIT 1、フィールドのデフォルトのマッピングは次のとおりです。
"markups": {
"properties": {
"1": {
"type": "date",
"format": "dateOptionalTime"
}
}
}
EDIT 2、完全な例外:
"error": "SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures {[UNsBpzvUT0eRh455sPvFoA][nyc01check-20150520-170219][0]: RemoteTransportException[[Caregiver][inet[/192.168.2.223:9300]][indices:data/read/search[phase/query]]]; nested: SearchParseException[[nyc01check-20150520-170219][0]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\ \ \"query\": {\ \ \"query_string\": {\ \ \"fields\": [\"markups.*\"], \ \ \"query\": \"[2015-01-01 TO 2015-05-20]\"\ \ }\ \ }\ \ }]]]; nested: NumberFormatException[For input string: \"2015-01-01\"]; }{[bZjjVX5zTGKDkfTsSU0lIg][nyc01check-20150520-170219][1]: RemoteTransportException[[Payback][inet[/192.168.2.227:9300]][indices:data/read/search[phase/query]]]; nested: SearchParseException[[nyc01check-20150520-170219][1]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\ \ \"query\": {\ \ \"query_string\": {\ \ \"fields\": [\"markups.*\"], \ \ \"query\": \"[2015-01-01 TO 2015-05-20]\"\ \ }\ \ }\ \ }]]]; nested: NumberFormatException[For input string: \"2015-01-01\"]; }{[pzbyI5Y_TvyzL-tpZGN1HQ][nyc01check-20150520-170219][2]: RemoteTransportException[[Living Monolith][inet[/192.168.2.224:9300]][indices:data/read/search[phase/query]]]; nested: SearchParseException[[nyc01check-20150520-170219][2]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\ \ \"query\": {\ \ \"query_string\": {\ \ \"fields\": [\"markups.*\"], \ \ \"query\": \"[2015-01-01 TO 2015-05-20]\"\ \ }\ \ }\ \ }]]]; nested: NumberFormatException[For input string: \"2015-01-01\"]; }{[bZjjVX5zTGKDkfTsSU0lIg][nyc01check-20150520-170219][3]: RemoteTransportException[[Payback][inet[/192.168.2.227:9300]][indices:data/read/search[phase/query]]]; nested: SearchParseException[[nyc01check-20150520-170219][3]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\ \ \"query\": {\ \ \"query_string\": {\ \ \"fields\": [\"markups.*\"], \ \ \"query\": \"[2015-01-01 TO 2015-05-20]\"\ \ }\ \ }\ \ }]]]; nested: NumberFormatException[For input string: \"2015-01-01\"]; }{[aoWs6XiITJGkBXCLog6eNA][nyc01check-20150520-170219][4]: RemoteTransportException[[Nomad][inet[/192.168.2.226:9300]][indices:data/read/search[phase/query]]]; nested: SearchParseException[[nyc01check-20150520-170219][4]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\ \ \"query\": {\ \ \"query_string\": {\ \ \"fields\": [\"markups.*\"], \ \ \"query\": \"[2015-01-01 TO 2015-05-20]\"\ \ }\ \ }\ \ }]]]; nested: NumberFormatException[For input string: \"2015-01-01\"]; }]",
"status": 400