일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- license delete
- licence delete curl
- flask
- token filter test
- matplotlib
- TensorFlow
- springboot
- zip 파일 암호화
- Elasticsearch
- aggregation
- ELASTIC
- Java
- high level client
- 차트
- aggs
- 파이썬
- analyzer test
- Python
- Mac
- zip 암호화
- query
- Kafka
- 900gle
- License
- MySQL
- sort
- Test
- API
- docker
- plugin
Archives
- Today
- Total
개발잡부
[es] NGram Test 본문
반응형
NGram 을 검색에 이용해 보자
NGram
unigram(유니그램 – 1글자)
bigram(바이그램 - 2자)
Elasticsearch는 NGram을 처리하는 토큰 필터를 제공하며 설정은 "type": "nGram" 으로 지정
#! The [nGram] token filter name is deprecated and will be removed in a future version. Please change the filter name to [ngram] instead.
nGram 을 ngram 으로 해야 한다는..
PUT doo_ngram
{
"settings": {
"analysis": {
"filter": {
"doo_ngram_filter": {
"type": "ngram",
"min_gram": 2,
"max_gram": 3
}
}
}
}
}
ngram 토큰 필터에는 min_gram (디폴트 1), max_gram (디폴트 2) 옵션이 있다.
GET doo_ngram/_analyze
{
"tokenizer": "keyword",
"filter": [
"doo_ngram_filter"
],
"text": "진격의거인"
}
{
"tokens" : [
{
"token" : "진격",
"start_offset" : 0,
"end_offset" : 5,
"type" : "word",
"position" : 0
},
{
"token" : "진격의",
"start_offset" : 0,
"end_offset" : 5,
"type" : "word",
"position" : 0
},
{
"token" : "격의",
"start_offset" : 0,
"end_offset" : 5,
"type" : "word",
"position" : 0
},
{
"token" : "격의거",
"start_offset" : 0,
"end_offset" : 5,
"type" : "word",
"position" : 0
},
{
"token" : "의거",
"start_offset" : 0,
"end_offset" : 5,
"type" : "word",
"position" : 0
},
{
"token" : "의거인",
"start_offset" : 0,
"end_offset" : 5,
"type" : "word",
"position" : 0
},
{
"token" : "거인",
"start_offset" : 0,
"end_offset" : 5,
"type" : "word",
"position" : 0
}
]
}
반응형
'ElasticStack > Elasticsearch' 카테고리의 다른 글
[es] Shingle Test (0) | 2022.12.11 |
---|---|
[es] Edge NGram Test (0) | 2022.12.11 |
[es] filter script (0) | 2022.11.30 |
[es]성능체크 (0) | 2022.11.24 |
[es] health check (0) | 2022.11.16 |
Comments