본문 바로가기

elasticsearch 5.검색 5. 검색예제 5.1 5_1_books.json 파일 내용을 벌크 API로 입력curl -XPOST localhost:9200/_bulk --data-binary @5_1_books.json curl -XPOST localhost:9200/_bulk --data-binary @5_2_magazines.json 5.1 검색(_search) API예제 5.2 books 인덱스, book 타입에서 hamlet 검색curl 'localhost:9200/books/book/_search?q=hamlet&pretty' 예제 5.3 books 인덱스에서 hamlet 검색curl 'localhost:9200/books/_search?q=hamlet&pretty' 예제 5.4 books, magazines 인덱스에서 t.. 더보기
elasticsearch 쿼리 예제와 설명. [웹] ElasticSearch query 예제ElasticSearch 쿼리 날리는 법 / aggregation 사용법 / 예제 / 복잡한 쿼리 / 몽고 db 의 aggregation 과 ElasticSearch 의 차이점 index, index type일단 query 를 위해서 간략한 용어는 익히고 가자. ElasticSearch 에서는 index 가 database 이고 type(index type) 이 table 의 역할을 한다. http://localhost:9200/_plugin/head/ query 를 날릴 때 사용할 tool기본툴(embedded tool)http://localhost:9200/_plugin/head/개인적으로 이녀석이 가장 나은 듯 하다. gist(gist)web page .. 더보기
elasticsearch flush에 대한 설명. flushThe flush API allows to flush one or more indices through an API. The flush process of an index basically frees memory from the index by flushing data to the index storage and clearing the internal transaction log. By default, Elasticsearch uses memory heuristics in order to automatically trigger flush operations as required in order to clear memory.POST /twitter/_flushVIEW IN SENSE Request.. 더보기
elasticsearch 최적화방법 및 데이터 copy refresh_interval 의 값은 인덱싱(색인) 을 얼마나 하는 주기를 의미한다. 일종의 flush 같은개념인데. 길면 길수록 성능은좋아지고, 짧은 수록 성능은 떨어진다. 테스트결과 짧게 주는것보다 길게 주는게 cpu의 성능이5%~15% 까지 상향. optimize 옵션 optimize 옵션은 빠른검색이 되도록 인덱싱을 최적화 한다. cpu 성능이 1%~3% 정도상향. sorting 커스터마이징 index.fielddata.cache : soft indices.fielddata.cache.size : 80% indices.fielddata.cache.expire : 24h 검색 ThreadPool 설정. threadpool : index: type : fixed size : 30 queue_size.. 더보기