use text/keyword instead of string in load example
This commit is contained in:
+7
-11
@@ -3,7 +3,6 @@
|
|||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
from os.path import dirname, basename, abspath
|
from os.path import dirname, basename, abspath
|
||||||
from itertools import chain
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
@@ -18,9 +17,9 @@ def create_git_index(client, index):
|
|||||||
user_mapping = {
|
user_mapping = {
|
||||||
'properties': {
|
'properties': {
|
||||||
'name': {
|
'name': {
|
||||||
'type': 'string',
|
'type': 'text',
|
||||||
'fields': {
|
'fields': {
|
||||||
'raw': {'type' : 'string', 'index' : 'not_analyzed'},
|
'raw': {'type': 'keyword'},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -53,9 +52,9 @@ def create_git_index(client, index):
|
|||||||
'authored_date': {'type': 'date'},
|
'authored_date': {'type': 'date'},
|
||||||
'committer': user_mapping,
|
'committer': user_mapping,
|
||||||
'committed_date': {'type': 'date'},
|
'committed_date': {'type': 'date'},
|
||||||
'parent_shas': {'type': 'string', 'index' : 'not_analyzed'},
|
'parent_shas': {'type': 'keyword'},
|
||||||
'description': {'type': 'string', 'analyzer': 'snowball'},
|
'description': {'type': 'text', 'analyzer': 'snowball'},
|
||||||
'files': {'type': 'string', 'analyzer': 'file_path'}
|
'files': {'type': 'text', 'analyzer': 'file_path'}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'repos': {
|
'repos': {
|
||||||
@@ -63,13 +62,10 @@ def create_git_index(client, index):
|
|||||||
'owner': user_mapping,
|
'owner': user_mapping,
|
||||||
'created_at': {'type': 'date'},
|
'created_at': {'type': 'date'},
|
||||||
'description': {
|
'description': {
|
||||||
'type': 'string',
|
'type': 'text',
|
||||||
'analyzer': 'snowball',
|
'analyzer': 'snowball',
|
||||||
},
|
},
|
||||||
'tags': {
|
'tags': {'type': 'keyword'}
|
||||||
'type': 'string',
|
|
||||||
'index': 'not_analyzed'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user