Estonian analyzer
출처: 문서
본문
에스토니아어 분석기
내장된 estonian 분석기는 다음 명령을 사용해 텍스트 필드에 적용할 수 있어요:
PUT /estonian-index
{
"mappings": {
"properties": {
"content": {
"type": "text",
"analyzer": "estonian"
}
}
}
}
{% include copy-curl.html %}
스테밍 제외
다음 명령을 사용하면 이 언어 분석기에서 stem_exclusion을 사용할 수 있어요:
PUT index_with_stem_exclusion_estonian_analyzer
{
"settings": {
"analysis": {
"analyzer": {
"stem_exclusion_estonian_analyzer": {
"type": "estonian",
"stem_exclusion": ["autoriteet", "kinnitus"]
}
}
}
}
}
{% include copy-curl.html %}
에스토니아어 분석기 내부 구조
estonian 분석기는 다음 구성 요소들로 만들어져 있어요:
-
토크나이저:
standard -
토큰 필터:
- lowercase
- stop (에스토니아어)
- keyword
- stemmer (에스토니아어)
커스텀 에스토니아어 분석기
다음 명령을 사용해 커스텀 에스토니아어 분석기를 만들 수 있어요:
PUT /estonian-index
{
"settings": {
"analysis": {
"filter": {
"estonian_stop": {
"type": "stop",
"stopwords": "_estonian_"
},
"estonian_stemmer": {
"type": "stemmer",
"language": "estonian"
},
"estonian_keywords": {
"type": "keyword_marker",
"keywords": []
}
},
"analyzer": {
"estonian_analyzer": {
"type": "custom",
"tokenizer": "standard",
"filter": [
"lowercase",
"estonian_stop",
"estonian_keywords",
"estonian_stemmer"
]
}
}
}
},
"mappings": {
"properties": {
"content": {
"type": "text",
"analyzer": "estonian_analyzer"
}
}
}
}
{% include copy-curl.html %}
생성된 토큰
다음 요청을 사용해 분석기가 생성한 토큰을 확인해 보세요:
POST /estonian-index/_analyze
{
"field": "content",
"text": "Õpilased õpivad Tallinnas ja Eesti ülikoolides. Nende numbrid on 123456."
}
{% include copy-curl.html %}
응답에는 생성된 토큰이 담겨 있어요:
{
"tokens": [
{"token": "õpilase","start_offset": 0,"end_offset": 8,"type": "<ALPHANUM>","position": 0},
{"token": "õpi","start_offset": 9,"end_offset": 15,"type": "<ALPHANUM>","position": 1},
{"token": "tallinna","start_offset": 16,"end_offset": 25,"type": "<ALPHANUM>","position": 2},
{"token": "eesti","start_offset": 29,"end_offset": 34,"type": "<ALPHANUM>","position": 4},
{"token": "ülikooli","start_offset": 35,"end_offset": 46,"type": "<ALPHANUM>","position": 5},
{"token": "nende","start_offset": 48,"end_offset": 53,"type": "<ALPHANUM>","position": 6},
{"token": "numbri","start_offset": 54,"end_offset": 61,"type": "<ALPHANUM>","position": 7},
{"token": "on","start_offset": 62,"end_offset": 64,"type": "<ALPHANUM>","position": 8},
{"token": "123456","start_offset": 65,"end_offset": 71,"type": "<NUM>","position": 9}
]
}