Elasticsearch:没有为[geo_shape]注册过滤器

时间:2014-04-13 22:20:36

标签: json elasticsearch geospatial

我有一个"县"索引,县文件类似于以下内容(为简洁省略了额外的多边形点):

{ "fips" : 1093,
  "location" : {
    "type" : "polygon",
    "coordinates" : [ [ [ -88.194525, 34.157699 ], [ -88.192128, 34.175351 ], ..., [ -88.194525, 34.157699 ] ] ]
  }
}

我为这些县创建了一个映射:

"mappings" : {
    "county" : {
            "properties" : {
            "location" : {
                "type" : "geo_shape"
                }
            }
        }
    }
}

然后我尝试使用如下查询查询这些文档:

{
  "query" : {
    "filtered" : {
      "query" : {
        "match_all" : { }
      },
      "filter" : {
        "geo_shape" : {
          "location" : {
            "shape" : {
              "type" : "envelope",
              "coordinates" : [[-87.17863946,41.57623478],[-87.17863846,41.57623578]]
            }
          }
        }
      }
    }
  }
}g

这会返回以下错误:

{[OQuTlmv0RdmC34MLnN8qHQ][counties][1]: SearchParseException[[counties][1]:  from[-1],size[-1]: Parse Failure [Failed to parse source [{\"query\":{\"filtered\":{\"query\":{\"match_all\":{}},\"filter\":{\"geo_shape\":{\"location\":{\"shape\":{\"type\":\"envelope\",\"coordinates\":[[-87.17863946,41.57623478],[-87.17863846,41.57623578]]}}}}}}}]]]; nested: QueryParsingException[[counties] No   filter registered for [geo_shape]]; }]",
"status" : 400

}

我在搜索时找不到任何类似错误的引用。我在过滤器和查询表单中尝试了这个,但有类似的错误。使用Elasticsearch 1.1.0。

0 个答案:

没有答案