From ef3820c4fe7aee6345b37a69c21e9b888251c9d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Honza=20Kr=C3=A1l?= Date: Mon, 12 Dec 2016 14:10:06 +1100 Subject: [PATCH] use text/keyword instead of string in load example --- example/load.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/example/load.py b/example/load.py index d54e137d..a99944e8 100644 --- a/example/load.py +++ b/example/load.py @@ -3,7 +3,6 @@ from __future__ import print_function from os.path import dirname, basename, abspath -from itertools import chain from datetime import datetime import logging @@ -18,9 +17,9 @@ def create_git_index(client, index): user_mapping = { 'properties': { 'name': { - 'type': 'string', + 'type': 'text', 'fields': { - 'raw': {'type' : 'string', 'index' : 'not_analyzed'}, + 'raw': {'type': 'keyword'}, } } } @@ -53,9 +52,9 @@ def create_git_index(client, index): 'authored_date': {'type': 'date'}, 'committer': user_mapping, 'committed_date': {'type': 'date'}, - 'parent_shas': {'type': 'string', 'index' : 'not_analyzed'}, - 'description': {'type': 'string', 'analyzer': 'snowball'}, - 'files': {'type': 'string', 'analyzer': 'file_path'} + 'parent_shas': {'type': 'keyword'}, + 'description': {'type': 'text', 'analyzer': 'snowball'}, + 'files': {'type': 'text', 'analyzer': 'file_path'} } }, 'repos': { @@ -63,13 +62,10 @@ def create_git_index(client, index): 'owner': user_mapping, 'created_at': {'type': 'date'}, 'description': { - 'type': 'string', + 'type': 'text', 'analyzer': 'snowball', }, - 'tags': { - 'type': 'string', - 'index': 'not_analyzed' - } + 'tags': {'type': 'keyword'} } } }