2016-04-21 25 views
0

在我的某个索引上运行查询时,Elastic上出现错误。ElasticSearch“无法以1:60在VALUE_NULL上获取文本”

{ 
    "error" : { 
    "root_cause" : [ { 
     "type" : "illegal_state_exception", 
     "reason" : "Can't get text on a VALUE_NULL at 1:60" 
    } ], 
    "type" : "search_phase_execution_exception", 
    "reason" : "all shards failed", 
    "phase" : "query", 
    "grouped" : true, 
    "failed_shards" : [ { 
     "shard" : 0, 
     "index" : "someIndexName", 
     "node" : "sfsfd5sdf", 
     "reason" : { 
     "type" : "illegal_state_exception", 
     "reason" : "Can't get text on a VALUE_NULL at 1:60" 
     } 
    } ] 
    }, 
    "status" : 500 
} 

我的配置:

{ 
    "cluster_name" : "clusterName", 
    "status" : "green", 
    "number_of_nodes" : 2, 
    "number_of_data_nodes" : 2, 
    "active_primary_shards" : 16, 
    "active_shards" : 32, 
    "relocating_shards" : 0, 
    "initializing_shards" : 0, 
    "unassigned_shards" : 0, 
    "delayed_unassigned_shards" : 0, 
    "number_of_pending_tasks" : 0, 
    "number_of_in_flight_fetch" : 0, 
    "task_max_waiting_in_queue_millis" : 0, 
    "active_shards_percent_as_number" : 100.0 
} 


"version" : { 
    "number" : "2.3.1", 
    "build_hash" : "bd980929010aef404e7cb0843e61d0665269fc39", 
    "build_timestamp" : "2016-04-04T12:25:05Z", 
    "build_snapshot" : false, 
    "lucene_version" : "5.5.0" 
}, 

犯规查询例如:

{ 
    "fields": ["id", "coordsField",null], 
    "query": { 
     "filtered": { 
      "query": { 
       "bool": { 
        "must": [], 
        "must_not": [], 
        "should": [], 
        "filter": [{ 
         "query_string": { 
          "default_field": "type", 
          "query": "type1 type2 type3 type4 type5" 
         } 
        }, { 
         "or": [{ 
          "exists": { 
           "field": "field0" 
          } 
         }, 
... 
         { 
          "exists": { 
           "field": "field6" 
          } 
         }] 
        }, { 
         "geo_bounding_box": { 
          "type": "indexed", 
          "coordsField": { 
           "top_left": { 
            "lat": 123.471723, 
            "lon": -123.173828 
           }, 
           "bottom_right": { 
            "lat": 123.937079, 
            "lon": 123.82373 
           } 
          } 
         } 
        }, { 
         "exists": { 
          "field": "field7" 
         } 
        }, { 
         "exists": { 
          "field": "field8.prop" 
         } 
        }], 
        "minimum_should_match": 1 
       } 
      }, 
      "filter": { 
       "geo_bounding_box": { 
        "coords.current.geometry.coordinates": { 
         "bottom_left": [-0.13623046875, 51.50600814450517], 
         "top_right": [-0.08349609375, 51.53881991608289] 
        }, 
        "type": "indexed" 
       } 
      } 
     } 
    }, 
    "size": 0, 
    "aggregations": { 
     "zoom1": { 
      "geohash_grid": { 
       "field": "coordsField", 
       "size": 5000, 
       "precision": 7 
      }, 
      "aggs": { 
       "geohash": { 
        "top_hits": { 
         "sort": { 
          "id": { 
           "order": "desc", 
           "ignore_unmapped": true 
          } 
         }, 
         "_source": false, 
         "fielddata_fields": ["id", "coordsField", null], 
         "size": 1 
        } 
       } 
      } 
     } 
    } 

}

用Google搜索,但没有找到任何有关。我应该从哪里开始搜索以了解原因?

+0

你可以发布查询吗? – keety

+0

完成后,查询与在dev中(2.2.1)中测试的查询相同,唯一可能稍微不同的是数据顺序和/或基于[代码片段](https://)的映射 –

+1

github.com/elastic/elasticsearch/blob/0f00c14afc8428a2a72c0b766d2171029dc8f6e1/core/src/main/java/org/elasticsearch/common/xcontent/json/JsonXContentParser.java#L85)异常似乎建议尝试将文本转换为'null'值。可能您可以查看easticsearch集群日志以查看消息是否有更多上下文 – keety

回答

0

的问题是在查询字段中的null

"fielddata_fields": ["id", "coordsField", null], 

VS

"fielddata_fields": ["id", "coordsField"], 

在旧版本Elasticsearch的(2.2.1)空被忽略。