'_all'에 해당되는 글 2건

  1. 2018.06.27 [Elasticsearch] _all field 사용하지 마세요.
  2. 2013.01.16 Using Elasticsearch for logs - 활용 팁.

[Elasticsearch] _all field 사용하지 마세요.

Elastic/Elasticsearch 2018. 6. 27. 12:23

_all 필드는 앞으로 사라질 예정입니다.

그러니 사용하지 않도록 합니다.


기본 _all 필드는 disabled 이기 때문에 별도 mapping 설정에 추가 하지 않으셔도 됩니다.

만약 사용 하실 거라면 아래 문서를 참고하세요.


Reference)

https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-all-field.html


_all enable 시 아래와 같은 경고 문구를 보실 수 있습니다.


returned 1 warnings: [299 Elasticsearch-6.3.0-424e937 "[_all] is deprecated in 6.0+ and will be

removed in 7.0. As a replacement, you can use [copy_to] on mapping fields to create your own

catch all field." "Wed, 27 Jun 2018 03:14:14 GMT"]


:

Using Elasticsearch for logs - 활용 팁.

Elastic/Elasticsearch 2013. 1. 16. 13:20

원문 : http://www.elasticsearch.org/tutorials/2012/05/19/elasticsearch-for-logging.html
번역 : http://socurites.com/122

http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html

http://www.elasticsearch.org/guide/reference/mapping/source-field.html

http://www.elasticsearch.org/guide/reference/mapping/all-field.html

http://www.elasticsearch.org/guide/reference/query-dsl/

http://www.elasticsearch.org/guide/reference/api/bulk.html


아무래도 이상해서 더 찾아 봤습니다. ㅋㅋ
http://www.elasticsearch.org/guide/reference/index-modules/store.html
이 문서를 보면 일단 _all 과 _source 는 reserved keyword 같구요. (소스 보기 귀찮아서 상상만.. )
문서 보고 store 옵션을 줘서 처리 했습니다.
결과는 ㅎㅎ 성공 ^^

"settings" : {
    "number_of_shards" : 50,
    "number_of_replicas" : 1,
    "index" : {
        "refresh_interval" : "1s",
        "term_index_interval" : "1",
        "store" : {
            "compress" : {
                "stored" : true,
                "tv" : true
            }
        }
    },

    "mappings" : {
        "type명" : {
            "properties" : {               
                "docid" : { "type" : "string", "store" : "yes", "index" : "not_analyzed", "include_in_all" : false },
                "seq" : { "type" : "long", "store" : "yes", "index" : "no", "include_in_all" : false }
            }
        }
    }
}

그리고 _all 에 대해서는 보시는 것 처럼 include_in_all : false 를 해서 _all 로는 어떤것도 매칭이 되지 않습니다.
이건 젤 위 문서에서 all-field.html 보시면 되겠습니다.
참고하시라고 압축율은 무려 80% 나 되내요.. ㅎㅎ


위 링크들 보고 열심히 튜닝 중이긴 한데.. 이게 효과가 있는건지 없는건지 알수가 없내요.. ㅡ.ㅡ;;
(_all, all, _source, source 이건 setting 할때 둘다 적용 되더라구요.)

"all" : {
            "enabled" : false
        },

"source" : {
            "enabled" : true,
        }

용도에 따라 disk 용량을 효율적으로 사용하기 위해서 위와 같은 구성을 했는데.. 흠.. 일단 용량은 조금 줄었는데.. 좀 큰 사이즈로 한번 돌려봐야 겠내요.

데이터 건수가 적은 걸로 돌렸을 때 옵션 안주고 돌리면
- 447MB

옵션주고 돌리면
- 438MB

9MB 절약 되었습니다. ^^;

: