Romanian analyzer
출처: 문서
본문
루마니아어 애널라이저
내장된 romanian 애널라이저는 다음 명령어를 사용해 텍스트 필드에 적용할 수 있어요:
PUT /romanian-index
{
"mappings": {
"properties": {
"content": {
"type": "text",
"analyzer": "romanian"
}
}
}
}
{% include copy-curl.html %}
스테밍 제외
다음 명령어를 사용하면 이 언어 애널라이저에서 stem_exclusion을 사용할 수 있어요:
PUT index_with_stem_exclusion_romanian_analyzer
{
"settings": {
"analysis": {
"analyzer": {
"stem_exclusion_romanian_analyzer": {
"type": "romanian",
"stem_exclusion": ["autoritate", "aprobat"]
}
}
}
}
}
{% include copy-curl.html %}
루마니아어 애널라이저 내부 구조
romanian 애널라이저는 다음 구성 요소들로 만들어져 있어요:
-
토크나이저:
standard -
토큰 필터:
- lowercase
- stop (Romanian)
- keyword
- stemmer (Romanian)
커스텀 루마니아어 애널라이저
다음 명령어를 사용해 커스텀 루마니아어 애널라이저를 만들 수 있어요:
PUT /romanian-index
{
"settings": {
"analysis": {
"filter": {
"romanian_stop": {
"type": "stop",
"stopwords": "_romanian_"
},
"romanian_stemmer": {
"type": "stemmer",
"language": "romanian"
},
"romanian_keywords": {
"type": "keyword_marker",
"keywords": []
}
},
"analyzer": {
"romanian_analyzer": {
"type": "custom",
"tokenizer": "standard",
"filter": [
"lowercase",
"romanian_stop",
"romanian_keywords",
"romanian_stemmer"
]
}
}
}
},
"mappings": {
"properties": {
"content": {
"type": "text",
"analyzer": "romanian_analyzer"
}
}
}
}
{% include copy-curl.html %}
생성된 토큰
애널라이저가 생성한 토큰을 살펴보려면 다음 요청을 사용해 보세요:
POST /romanian-index/_analyze
{
"field": "content",
"text": "Studenții învață la universitățile din România. Numerele lor sunt 123456."
}
{% include copy-curl.html %}
응답에는 생성된 토큰이 담겨 있어요:
{
"tokens": [
{
"token": "studenț",
"start_offset": 0,
"end_offset": 9,
"type": "<ALPHANUM>",
"position": 0
},
{
"token": "învaț",
"start_offset": 10,
"end_offset": 16,
"type": "<ALPHANUM>",
"position": 1
},
{
"token": "universităț",
"start_offset": 20,
"end_offset": 34,
"type": "<ALPHANUM>",
"position": 3
},
{
"token": "român",
"start_offset": 39,
"end_offset": 46,
"type": "<ALPHANUM>",
"position": 5
},
{
"token": "numer",
"start_offset": 48,
"end_offset": 56,
"type": "<ALPHANUM>",
"position": 6
},
{
"token": "123456",
"start_offset": 66,
"end_offset": 72,
"type": "<NUM>",
"position": 9
}
]
}