Elasticsearch
elasticsearch의 geo distance filter 의 결과는 caching하지 않는다.(디폴트)
'김용환'
2015. 5. 6. 13:59
elasticsearch의 geo distance filter의 결과에 대해서 디폴트로 caching하지 않는다. caching하려면 cache값을 true로 지정해야 한다.
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);