elasticsearch.exceptions.RequestError:RequestError(400,'mapper_parsing_exception','在字

elasticsearch.exceptions.RequestError:RequestError(400,'mapper_parsing_exception','在字,第1张

elasticsearch.exceptions.RequestError:RequestError(400,'mapper_parsing_exception','在字

这个

‘index’:’analyzed’或’index’:’not_analyzed’

是较旧的Elasticsearch版本映射,不需要。

您需要做的就是对分析的字符串字段使用“ text ”,对未经分析的文本字段使用“ keyword ”,如下所示:

es = Elasticsearch("localhost:9200")request_body = {    "settings": {        "number_of_shards": 5,        "number_of_replicas": 1    },    'mappings': {        'examplecase': { 'properties': {     'tbl_id': {'type': 'keyword'},     'texts': {'type': 'text'}, }        }    }}es.indices.create(index='example_index', body=request_body)

请在此处查看Elastic
docs中的参考:https
:
//www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html




欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/4879406.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-11-11
下一篇 2022-11-11

发表评论

登录后才能评论

评论列表(0条)

保存