From 27375b55fe906f72f6e6bb83a048c9db2412f442 Mon Sep 17 00:00:00 2001 From: Bob Sin Date: Tue, 14 May 2024 05:45:57 +0900 Subject: [PATCH] =?UTF-8?q?[KAN-62]=20es=20=ED=95=84=EB=93=9C=20=EC=9D=BC?= =?UTF-8?q?=EB=B6=80=20=EB=84=A4=EC=9D=B4=EB=B0=8D=20=EB=B3=80=EA=B2=BD=20?= =?UTF-8?q?(#11)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- csv-to-es.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/csv-to-es.py b/csv-to-es.py index aa8591d..c55cf64 100644 --- a/csv-to-es.py +++ b/csv-to-es.py @@ -29,13 +29,13 @@ "mappings": { "properties": { "name": {"type": "text", "analyzer": "korean"}, - "category": {"type": "text", "analyzer": "korean"}, + "original_category": {"type": "text", "analyzer": "korean"}, "naver_review_count": {"type": "text", "analyzer": "korean"}, "address": {"type": "text", "analyzer": "korean"}, "naver_rating": {"type": "float"}, "number": {"type": "text"}, "image_url": {"type": "text"}, - "custom_category": {"type": "text", "analyzer": "korean"}, + "category": {"type": "text", "analyzer": "korean"}, "menus": { "type": "nested", "properties": { @@ -79,13 +79,13 @@ print(row['name'], row['category'], row['review_count'], row['address'], rating, number, restaurant_image_url, menus) response = es.index(index=index_name, id=row['name'], document={ "name": row['name'], - "category": row['category'], + "original_category": row['category'], "naver_review_count": row['review_count'], "address": row['address'], "naver_rating": rating, "number": number, "image_url": restaurant_image_url, - "custom_category": row['custom_category'], + "category": row['custom_category'], "menus": menus, }) print(f"Indexed document ID: {response['_id']}, Result: {response['result']}")