0

When I run

./manage.py search_index --rebuild

I get the following error:

 elasticsearch.exceptions.RequestError: RequestError(400, 'mapper_parsing_exception', 'Root mapping definition has unsupported parameters:  [bodystyle : {type=text}] [model : {type=text}] [carclass : {type=text}] [version : {type=text}]')

I have tried to change the version of my elasticsearch. My current version is:

$ curl -XGET 'localhost:9200' { "name" : "MOkbeEQ", "cluster_name" : "elasticsearch", "cluster_uuid" : "pF_Z62bBTl-Jq31HSuAhQA", "version" : { "number" : "5.6.8", "build_hash" : "688ecce", "build_date" : "2018-02-16T16:46:30.010Z", "build_snapshot" : false, "lucene_version" : "6.6.1" }, "tagline" : "You Know, for Search" }

My documents.py code is as below:

from django_elasticsearch_dsl import Document
from django_elasticsearch_dsl.registries import registry
from products.models import Product_Model


@registry.register_document
class CarDocument(Document):
    class Index:
        # Name of the Elasticsearch index
        name = 'cars'
        # See Elasticsearch Indices API reference for available settings
        settings = {'number_of_shards': 1,
                    'number_of_replicas': 0}

class Django:
    model = Product_Model # The model associated with this Document

    # The fields of the model you want to be indexed in Elasticsearch
    fields = [
        'model',
        'version',
        'carclass',
        'bodystyle',
    ]

1 Answer 1

0

Are you migrating to elasticsearch version 6/7? try to upgrade your django_elasticsearch_dsl version

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.