[Elasticsearch] Settings/Mappings 테스트 템플릿

Elastic/Elasticsearch 2018. 12. 19. 09:46

그냥 뭐 급하게 테스트 할 때 필요해서 올려 놓고 쓰려고 합니다.

(git 에 올리면 될 것을 ㅡ.ㅡ;;)


http://localhost:9200/helloworld

{

    "settings": {

        "index": {

            "number_of_shards": 1,

            "number_of_replicas": 0,

            "analysis": {

                "analyzer": {

                    "custom_analyzer": {

                        "tokenizer": "standard",

                        "filter": [

                            "lowercase",

                            "trim",

                            "custom_synonym"

                        ]

                    },

                    "cnori_analyzer" : {

                    "type" : "custom",

                    "tokenizer" : "cnori_tokenizer"

                    }

                },

                "tokenizer" : {

                "cnori_tokenizer" : {

                "type": "nori_tokenizer",

            "decompound_mode": "mixed"

                }

                },

                "filter": {

                    "custom_synonym": {

                        "type": "synonym_graph",

                        "synonyms": []

                    }

                }

            }

        }

    },

    "mappings": {

        "_doc": {

            "properties": {

                "title": {

                    "type": "text",

                    "analyzer" : "cnori_analyzer",

                    "fielddata" : true

                },

                "name": {

                    "type": "keyword"

                },

                "age": {

                    "type": "integer"

                },

                "created": {

                    "type": "date",

                    "format": "strict_date_optional_time||epoch_millis"

                }

            }

        }

    }

}



: