Indonesian analyzer
출처: 문서
본문
인도네시아어 분석기
내장된 indonesian 분석기는 다음 명령어를 사용해 텍스트 필드에 적용할 수 있어요:
PUT /indonesian-index
{
"mappings": {
"properties": {
"content": {
"type": "text",
"analyzer": "indonesian"
}
}
}
}
{% include copy-curl.html %}
어간 제외
stem_exclusion은 다음 명령어를 사용해 이 언어 분석기와 함께 사용할 수 있어요:
PUT index_with_stem_exclusion_indonesian_analyzer
{
"settings": {
"analysis": {
"analyzer": {
"stem_exclusion_indonesian_analyzer": {
"type": "indonesian",
"stem_exclusion": ["otoritas", "persetujuan"]
}
}
}
}
}
{% include copy-curl.html %}
인도네시아어 분석기 내부 구조
indonesian 분석기는 다음 구성 요소들로 이루어져 있어요:
-
토크나이저:
standard -
토큰 필터:
- lowercase
- stop (Indonesian)
- keyword
- stemmer (Indonesian)
커스텀 인도네시아어 분석기
다음 명령어를 사용해 커스텀 인도네시아어 분석기를 만들 수 있어요:
PUT /indonesian-index
{
"settings": {
"analysis": {
"filter": {
"indonesian_stop": {
"type": "stop",
"stopwords": "_indonesian_"
},
"indonesian_stemmer": {
"type": "stemmer",
"language": "indonesian"
},
"indonesian_keywords": {
"type": "keyword_marker",
"keywords": []
}
},
"analyzer": {
"indonesian_analyzer": {
"type": "custom",
"tokenizer": "standard",
"filter": [
"lowercase",
"indonesian_stop",
"indonesian_keywords",
"indonesian_stemmer"
]
}
}
}
},
"mappings": {
"properties": {
"content": {
"type": "text",
"analyzer": "indonesian_analyzer"
}
}
}
}
{% include copy-curl.html %}
생성된 토큰
다음 요청을 사용해 분석기가 생성한 토큰을 확인해 보세요:
POST /indonesian-index/_analyze
{
"field": "content",
"text": "Mahasiswa belajar di universitas Indonesia. Nomor mereka adalah 123456."
}
{% include copy-curl.html %}
응답에는 생성된 토큰이 담겨 있어요:
{
"tokens": [
{
"token": "mahasiswa",
"start_offset": 0,
"end_offset": 9,
"type": "<ALPHANUM>",
"position": 0
},
{
"token": "ajar",
"start_offset": 10,
"end_offset": 17,
"type": "<ALPHANUM>",
"position": 1
},
{
"token": "universitas",
"start_offset": 21,
"end_offset": 32,
"type": "<ALPHANUM>",
"position": 3
},
{
"token": "indonesia",
"start_offset": 33,
"end_offset": 42,
"type": "<ALPHANUM>",
"position": 4
},
{
"token": "nomor",
"start_offset": 44,
"end_offset": 49,
"type": "<ALPHANUM>",
"position": 5
},
{
"token": "123456",
"start_offset": 64,
"end_offset": 70,
"type": "<NUM>",
"position": 8
}
]
}