查看下面的查询,我在geo_shape过滤器前面添加了一个缓存的geo_bounding_box过滤器。我在阅读https://www.elastic.co/guide/en/elasticsearch/guide/current/geo-caching.html后的期望是这个查询应该更快。但是,在我的基准测试中,使用两个过滤器的查询平均稍微慢一点,而在最坏的情况下则慢得多。我做错了什么,或者误解了文档?
{
"query": {
"filtered": {
"filter": {
"bool" : {
"must" : [
{"geo_bounding_box" : {
"_cache": True,
"properties.center" : {
"top_left" : {
"lat" : math.ceil(float(lat)),
"lon" : math.floor(float(lon))
},
"bottom_right" : {
"lat" : math.floor(float(lat)),
"lon" : math.ceil(float(lon))
}
}
}},
{"geo_shape": {
"geometry": {
"relation": "intersects",
"shape": {
"coordinates": [lon,lat],
"type": "point"
}
}
}}
]
}
}
}
}
}
答案 0 :(得分:0)
使用小写JSON布尔值:
"_cache": true