Created
April 8, 2019 13:36
-
-
Save chokkoyamada/512c1e0af97aea023e42fb0e4b41ee2d to your computer and use it in GitHub Desktop.
Elasticsearch template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PUT /_template/sample | |
{ | |
"template": "sample*", | |
"settings": { | |
"analysis" : { | |
"analyzer" : { | |
"ja-ma-analyzer" : { | |
"type" : "custom", | |
"tokenizer" : "ja-ma-tokenizer" | |
}, | |
"ja-1gram-analyzer" : { | |
"type" : "custom", | |
"tokenizer" : "ja-1gram-tokenizer" | |
} | |
}, | |
"tokenizer": { | |
"ja-ma-tokenizer": { | |
"type": "kuromoji_tokenizer", | |
"mode": "normal" | |
}, | |
"ja-1gram-tokenizer": { | |
"type" : "nGram", | |
"min_gram" : "1", | |
"max_gram" : "3" | |
} | |
} | |
} | |
}, | |
"mappings": { | |
"_default_" : { | |
"dynamic_templates" : [ | |
{ | |
"sample_text_for_ma" : { | |
"match" : "text-ja-ma", | |
"mapping" : { | |
"type" : "text", | |
"store": "true", | |
"analyzer" : "ja-ma-analyzer" | |
} | |
} | |
}, | |
{ | |
"sample_text_for_1gram" : { | |
"match" : "text-ja-1gram", | |
"mapping" : { | |
"type" : "text", | |
"store" : "true", | |
"analyzer" : "ja-1gram-analyzer" | |
} | |
} | |
} | |
] | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment