[Elasticsearch] Arirang classpath 미등록 시.

Elastic/Elasticsearch 2022. 2. 15. 10:11

arirang plugin 을 사용 하면서 사전 데이터에 대한 classpath 설정은 했는데 config/dictionary path 생성을 하지 않았을 경우 reload api 가 동작 하지 않는다고 합니다.

 

이럴 경우 config/dictionary path 생성 하고 사전 데이터 배포 후 node 를 재시작 해주셔야 하는 번거로움이 있으니 초기 설치 시 꼭 사전 데이터에 대한 배포 후 실행을 해주시면 좋을 것 같습니다.

 

혹시 같은 실수 반복 할 수도 있어서 기록합니다.

:

[Elastic] Elastic Contributor Program - 2022, 2021

Elastic 2022. 2. 10. 13:03

2022년에는 방식이 변경 된다고 해서 활동을 거의 하지 않았는데 다행히 Bronze 를 주셨네요. ^^

참여 하고 싶으신 분들은 아래 링크 통해서 하시면 됩니다.

 

https://contributor-program.app.elstc.co/

Elastic Bronze Contributor 2022

 

Elastic Bronze Contributor 2021

:

[Elasticsearch] Exists Query...

Elastic/Elasticsearch 2022. 1. 28. 11:44

공식 문서)

Exists query | Elasticsearch Guide [7.16] | Elastic

 

exists query 는 field 자체가 아래 이유등으로 인해 생성 되자 않는 문서를 찾습니다.

즉, 

- null 또는 empty array (빈문자열 "" 은 해당 되지 않습니다.)

- index: false

- ignore_above 설정 값을 넘었을 때

- ignore_malformed 설정에 걸렸을 때

 

검색 엔진 특성상 null, empty string 에 대해서는 전처리를 통해서 명확히 제거 하거나 목적에 맞게 변형 하는 것이 좋습니다.

 

검색엔진을 이용해서 field:"" 또는 field: " " 과 같은 질의를 작성 하는 것은 좋지 않습니다.

 

:

[Elasticsearch] Aggs - Cardinality, Derivative, Cumulative...

Elastic/Elasticsearch 2022. 1. 28. 11:37

공식 문서)

Cardinality aggregation | Elasticsearch Guide [7.16] | Elastic

Derivative aggregation | Elasticsearch Guide [7.16] | Elastic

Cumulative cardinality aggregation | Elasticsearch Guide [7.16] | Elastic

 

현재 값과 직전 값에 대한 차이를 구합니다.

공식 문서에 자세한 내용들이 나와 있으니 보시면 좋습니다.

 

제가 사용 했던 예제는 공식 문서에 있는 거 활용 했습니다.

 

DAU 를 cardinality aggs 로 구하고 

Daily DAU 에 대한 누적 카운트를 cumulative_cardinality aggs 로 구하고 (여기서 buckets_path 는 cardinality aggs) 

Daily DAU 에 대한 변화를 derivative aggs 로 구했습니다. (여기서 buckets_path 는 cumulative_cardinality aggs)

 

아래는 공식 문서 예제 올려 둔 내용입니다.

GET /user_hits/_search
{
  "size": 0,
  "aggs": {
    "users_per_day": {
      "date_histogram": {
        "field": "timestamp",
        "calendar_interval": "day"
      },
      "aggs": {
        "distinct_users": {
          "cardinality": {
            "field": "user_id"
          }
        },
        "total_new_users": {
          "cumulative_cardinality": {
            "buckets_path": "distinct_users" 
          }
        }
      }
    }
  }
}

 

:

[Python] pyenv install from local tar.xz 설치 하기.

ITWeb/개발일반 2022. 1. 24. 12:12

맥북 기준으로 작성 합니다.

 

$HOME/.pyenv/cache

위 경로에 설치 하고자 하는 python tar.xz 파일을 다운로드 받아서 넣어 두고 진행을 하면 됩니다.

 

$ wget https://www.python.org/ftp/python/3.9.9/Python-3.9.9.tar.xz 

$ mv ~/Downloads/Python-3.9.9.tar.xz ~/.pyenv/cache/

$ pyenv install 3.9.9

 

이와 같이 하면 설치가 가능 합니다.

사내 보안 정책으로 설치가 안될 경우 활용 하면 됩니다.

 

: