Skip to content

elasticsearch.exceptions.RequestError #2

@lucas-acc

Description

@lucas-acc

大神你好!
我把Elasticsearch下好了,服务挂起来了,但是运行python insert_es.py时发生了如下错误:
Traceback (most recent call last): File "insert_es.py", line 161, in <module> init_ES() File "insert_es.py", line 111, in init_ES pie.create_mapping() File "insert_es.py", line 72, in create_mapping self.es.indices.create(index=self._index, body=node_mappings) File "/Users/wuhaixu/anaconda3/lib/python3.7/site-packages/elasticsearch/client/utils.py", line 84, in _wrapped return func(*args, params=params, **kwargs) File "/Users/wuhaixu/anaconda3/lib/python3.7/site-packages/elasticsearch/client/indices.py", line 105, in create "PUT", _make_path(index), params=params, body=body File "/Users/wuhaixu/anaconda3/lib/python3.7/site-packages/elasticsearch/transport.py", line 353, in perform_request timeout=timeout, File "/Users/wuhaixu/anaconda3/lib/python3.7/site-packages/elasticsearch/connection/http_urllib3.py", line 251, in perform_request self._raise_error(response.status, raw_data) File "/Users/wuhaixu/anaconda3/lib/python3.7/site-packages/elasticsearch/connection/base.py", line 178, in _raise_error status_code, error_message, additional_info elasticsearch.exceptions.RequestError: RequestError(400, 'mapper_parsing_exception', 'Root mapping definition has unsupported parameters: [music : {properties={song={search_analyzer=ik_smart, analyzer=ik_max_word, index=true, type=text}, geci={search_analyzer=ik_smart, analyzer=ik_max_word, index=true, type=text}, singer={search_analyzer=ik_smart, analyzer=ik_max_word, index=true, type=text}, album={search_analyzer=ik_smart, analyzer=ik_max_word, index=true, type=text}, composer={search_analyzer=ik_smart, analyzer=ik_max_word, index=true, type=text}, author={search_analyzer=ik_smart, analyzer=ik_max_word, index=true, type=text}}}]')

我上网查到 How to fix ElasticSearch ‘Root mapping definition has unsupported parameters’,说是json格式不对。既然大神已经跑通过,数据格式肯定是没问题的,所以来问问大神这个错误应该从哪里入手。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions