elasticsearch의 geo distance filter의 결과에 대해서 디폴트로 caching하지 않는다. caching하려면 cache값을 true로 지정해야 한다. 


http://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-geo-distance-filter.html#_geo_point_type_2


Cachingedit

The result of the filter is not cached by default. The _cache can be set to true to cache the result of the filter. This is handy when the same point and distance parameters are used on several (many) other queries. Note, the process of caching the first execution is higher when caching (since it needs to satisfy different queries).


java API를 쓸 때는 이렇게 쓴다. 


// geo 정보 검색 in 3 km

GeoDistanceFilterBuilder geoDistnaceFilterBuilder =

FilterBuilders.geoDistanceFilter("user_lat_lon")

.distance(3, DistanceUnit.KILOMETERS).lat(37.5133128626990).lon(127.10022875908237).cache(true);


Posted by '김용환'
,