0

我想对多个字段或带有后缀的字段(如markups.*. 似乎没有办法在Nestor中执行此操作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"
        }
      }
  }
}

编辑 1,这是该字段的默认映射:

"markups": {
"properties": {
"1": {
"type": "date",
"format": "dateOptionalTime"
}
}
}

编辑 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
4

1 回答 1

0

为此用途query_string

{
  "query": {
    "query_string": {
      "fields": ["markups.*"], 
      "query": "[2015-01-01T00:00:00.000 TO 2015-05-20T10:49:07.608]"
    }
  }
}
于 2015-05-20T20:21:09.453 回答