Skip to content

Instantly share code, notes, and snippets.

@binhqd
Last active May 3, 2019 07:29
Show Gist options
  • Save binhqd/c0e2ddec53e8fc3d55bde6dcbe31ef48 to your computer and use it in GitHub Desktop.
Save binhqd/c0e2ddec53e8fc3d55bde6dcbe31ef48 to your computer and use it in GitHub Desktop.
Elasticsearch classification
{
"settings": {
"index": {
"analysis": {
"analyzer" : {
"romaji_analyzer" : {
"tokenizer" : "kuromoji_tokenizer",
"filter" : ["romaji_readingform"]
},
"katakana_analyzer" : {
"tokenizer" : "kuromoji_tokenizer",
"filter" : ["katakana_readingform"]
}
},
"filter" : {
"romaji_readingform" : {
"type" : "kuromoji_readingform",
"use_romaji" : true
},
"katakana_readingform" : {
"type" : "kuromoji_readingform",
"use_romaji" : false
}
}
}
}
},
"mappings": {
"_doc": {
"properties":{
"last_modified": {
"type": "date"
},
"content_en":{
"type":"text",
"term_vector": "yes",
"analyzer":"english"
},
"content_ja":{
"type":"text",
"term_vector": "yes",
"analyzer":"katakana_analyzer"
},
"category":{
"type":"keyword"
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment