Skip to content

Commit

Permalink
[KAN-48] batch에 nori 적용 (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
sinkyoungdeok authored May 10, 2024
1 parent 7f01aec commit 53eb2cc
Showing 1 changed file with 31 additions and 18 deletions.
49 changes: 31 additions & 18 deletions csv-to-es.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,37 @@

# 새 인덱스 생성 및 매핑 설정
if not es.indices.exists(index=index_name):
es.indices.create(index=index_name, mappings={
"properties": {
"name": {"type": "text"},
"category": {"type": "text"},
"review_count": {"type": "text"},
"address": {"type": "text"},
"rating": {"type": "float"},
"number": {"type": "text"},
"image_url": {"type": "text"},
"custom_category": {"type": "text"},
"menus": {
"type": "nested",
"properties": {
"menu_name": {"type": "text"},
"price": {"type": "text"},
"description": {"type": "text"},
"is_representative": {"type": "text"},
"image_url": {"type": "text"}
es.indices.create(index=index_name, body={
"settings": {
"analysis": {
"analyzer": {
"korean": {
"type": "custom",
"tokenizer": "nori_tokenizer",
"filter": ["nori_readingform"]
}
}
}
},
"mappings": {
"properties": {
"name": {"type": "text", "analyzer": "korean"},
"category": {"type": "text", "analyzer": "korean"},
"review_count": {"type": "text", "analyzer": "korean"},
"address": {"type": "text", "analyzer": "korean"},
"rating": {"type": "float"},
"number": {"type": "text"},
"image_url": {"type": "text"},
"custom_category": {"type": "text", "analyzer": "korean"},
"menus": {
"type": "nested",
"properties": {
"menu_name": {"type": "text", "analyzer": "korean"},
"price": {"type": "text"},
"description": {"type": "text", "analyzer": "korean"},
"is_representative": {"type": "text"},
"image_url": {"type": "text"}
}
}
}
}
Expand Down

0 comments on commit 53eb2cc

Please sign in to comment.