elasticsearch

    Elasticsearch function_score 스코어 계산

    검색 정확도 기준 BM25 알고리즘을 이용해 문서에 대한 score 계산 TF (Term Frequency) 문서 내에서 자주 등장하는 단어(Term) 에 가중치를 높게 부여, 문서내에서 같은 단어가 여러번 등장한다면 그 단어에 높은 가중치를 주는 알고리즘 IDF (Inverse Document Frequency) 많은 문서에서 등장하는 단어의 가중치는 낮추고, 일부 문서에만 등장하는 단어에 대해 높은 가중치 부여 전체 문서에서 발생한 term 빈도수가 작을수록 weight가 높다. 문서에 자주 등장하는 단어일수록 낮은 가중치를 주는 알고리즘 똑같이 1번 검색이 되었다 하더라도 문서에 자주 등장한 단어가 매칭된 키워드일수록 낮은 가중치 문서에 많이 나오는게 좋은게 아닌가? 라고 생각할 수 있겠지만 문서에..

    index illegal_argument_exception

    Elasticsearch 에서 Index 삭제 시, Wildcard 로 요청하면,--> Wildcard expressions or all indices are not allowed 에러가 발생하면서 삭제가 안됨.curl -XDELETE "localhost:9200/"{ "error" : { "root_cause" : [ { "type" : "illegal_argument_exception", "reason" : "Wildcard expressions or all indices are not allowed" } ], "type" : "illegal_argument_exception", "reason" : "Wildcard expression..

    조건에 따른 특정 Document 데이터 삭제

    # 1341번 게시글 삭제curl -XPOST "localhost:9200/board-202205/_delete_by_query" -H 'Content-Type: application/json' -d '{ "query": { "match": { "_id": "1341" } }}'# writer 필드가 없는 게시글 일괄 삭제curl -XPOST "localhost:9200/board-202205/_delete_by_query" -H 'Content-Type: application/json' -d '{ "query": { "bool": { "must_not": { "exists": { "field": "wri..

    [Elasticsearch] monitoring execution failed 오류

    Elasticsearch 로그 모니터링 중, 아래와 같은 오류가 발생했다. [2020-03-19T00:00:17,340][WARN ][o.e.x.m.MonitoringService] [xx-xx-log-1] monitoring execution failed org.elasticsearch.xpack.monitoring.exporter.ExportException: Exception when closing export bulk at org.elasticsearch.xpack.monitoring.exporter.ExportBulk$1$1.(ExportBulk.java:95) ~[?:?] at org.elasticsearch.xpack.monitoring.exporter.ExportBulk$1.onFailur..

    Elasticsearch Cluster 재기동, Rolling restart

    2EA 이상 Cluster로 구성된 Elasticsearch 서버를 재기동 해야할 때, 하나의 Elasticsearch를 서비스 종료 시, 데이터 Node들이 relocate 되서, 많은 리소스가 소모 된다. 빠르게 재기동 하기 위해서는 이 relocate 옵션을 끄고 진행한다. shard allocation 옵션을 disable $ curl -X PUT "localhost:9200/_cluster/settings?pretty" -H 'Content-Type: application/json' -d' { "transient" : { "cluster.routing.allocation.enable" : "none" } } ' 노드 shutdown $ curl -XPOST 'localhost:9200/_clus..

    kibana unassigned 처리

    Elasticsearch의 ./kibana index가 Unassigned 발생하는 이유는 ./kibana index의 number_of_replicas 값이 ES의 기본 설정값 보다 높은 경우 발생한다. 이런 경우 ./kibana index의 template 값을 변경 $ curl -XPUT 'localhost:9200/.kibana/_settings' -H 'Content-Type: application/json' -d ' { "index" : { "number_of_replicas" : 0 } } '