-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
In the core.models
, inside the class Meta
, this code snippet:
class Meta:
es_index_name = 'django'
es_type_name = 'student'
es_mapping = {
'properties': {
'university': {
'type': 'object',
'properties': {
'name': {'type': 'string', 'index': 'not_analyzed'},
}
},
'first_name': {'type': 'string', 'index': 'not_analyzed'},
'last_name': {'type': 'string', 'index': 'not_analyzed'},
'age': {'type': 'short'},
'year_in_school': {'type': 'string'},
'name_complete': {
'type': 'completion',
'analyzer': 'simple',
'payloads': True,
'preserve_separators': True,
'preserve_position_increments': True,
'max_input_length': 50,
},
"course_names": {
"type": "string", "store": "yes", "index": "not_analyzed",
},
}
}
def get_es_name_complete(self):
return {
"input": [self.first_name, self.last_name],
"output": "%s %s" % (self.first_name, self.last_name),
"payload": {"pk": self.pk},
}
So, while following the tutorial from here
I execute the python manage.py push-to-index
. But it generates the error Mapping definition for [name_complete] has unsupported parameters: [payloads : true]
. I found out that payloads
is not supported in Elastic Search 5.5.0
.
So is it possible to give some tutorial on how to write those code snippet on the new version of Elastic Search
without the payloads
or any hints would save me finish my term project?
Metadata
Metadata
Assignees
Labels
No labels