I tried to create search index in elastic search using document and manually both gives error:
curl -X PUT "localhost:9200/elastic_book" -H 'Content-Type: application/json' -d'
{
"mappings": {
"properties": {
"title": { "type": "text" },
"description": { "type": "text" },
"author": { "type": "text" }
}
}
}
'
{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"Root mapping definition has unsupported parameters: [author : {type=text}] [description : {type=text}] [title : {type=text}]"}],"type":"mapper_parsing_exception","reason":"Failed to parse mapping [properties]: Root mapping definition has unsupported parameters: [author : {type=text}] [description : {type=text}] [title : {type=text}]","caused_by":{"type":"mapper_parsing_exception","reason":"Root mapping definition has unsupported parameters: [author : {type=text}] [description : {type=text}] [title : {type=text}]"}},"status":400}
PUBLISHER_INDEX = Index('elastic_book')
PUBLISHER_INDEX.settings(
number_of_shards=1,
number_of_replicas=1
)
@PUBLISHER_INDEX.doc_type
class BookDocument(Document):
title = fields.TextField()
description = fields.TextField()
author = fields.TextField()
class Django:
model = Book
when i run the python manage.py search_index –rebuild
command it gives : raise HTTP_EXCEPTIONS.get(status_code, TransportError)(
elasticsearch.exceptions.RequestError: RequestError(400, ‘mapper_parsing_exception’, ‘Root mapping definition has unsupported parameters: [author : {type=text}] [description : {type=text}] [title : {type=text}]’)