Skip to content

Instantly share code, notes, and snippets.

@bowbowbow
Created August 21, 2019 18:43
Show Gist options
  • Save bowbowbow/ed60069b7c000b020de011460432a4f0 to your computer and use it in GitHub Desktop.
Save bowbowbow/ed60069b7c000b020de011460432a4f0 to your computer and use it in GitHub Desktop.
"settings": {
"index": {
"analysis": {
"analyzer": {
"korean": {
"type": "custom",
"tokenizer": "seunjeon_default_tokenizer",
"min_token_length": 2,
"decompound_mode": "mixed",
"filter": ['cobak_synonym_filter', 'token_length_filter'],
},
"cobak_analyzer": {
"tokenizer": "cobak_ngram",
"filter": ['cobak_synonym_filter', 'token_length_filter'],
},
},
"filter": {
"token_length_filter": {
"type": "length",
"min": 2,
"max": 15,
},
"cobak_synonym_filter": {
"type": "synonym",
"synonyms": synonyms,
},
},
"tokenizer": {
"seunjeon_default_tokenizer": {
"type": "seunjeon_tokenizer",
"user_words": user_words,
},
"cobak_ngram": {
"type": "ngram",
"min_gram": 2,
"max_gram": 3,
"user_words": user_words,
},
},
},
}
},
"mappings": {
"post": {
"properties": {
"board_id": {
"type": "integer",
},
"title": {
"type": "text",
"analyzer": "korean",
"similarity": "boolean",
},
"topic_id": {
"type": "integer",
},
"user_nickname": {
"type": "text",
},
"contents": {
"type": "text",
"analyzer": "korean",
"similarity": "boolean",
},
"score": {
"type": "integer",
},
"created_time": {
"type": "date",
},
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment