Elasticsearch
[elasticsearch] count (개수 계산) api
'김용환'
2015. 6. 3. 20:17
일래스틱서치는 검색보다 counting(개수 계산)이 빠르다. 결과가 필요하지 않는다면 counting(개수 계산)을 사용하는 것이 좋다.
개수 계산은 일래스틱서치에서 2가지 방식으로 구할 수 있다. 데이터를 수집하는 것보다 훨씬 자원(cpu, memory)을 적게 사용하므로 좋다.
http://www.elasticsearch.org/guide/reference/api/count/
https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-search-type.html
curl -XPOST http://localhost:9200/order/item/_count -d {.. }
curl -XPOST http://localhost:9200/order/item/_search?search_type=count -d {.. }