相关疑难解决方法(0)

elasticsearch.exceptions.RequestError: RequestError(400, 'mapper_parsing_exception', '没有在字段 [texts] 上声明的类型 [string] 的处理程序')

我使用elasticsearch python api来创建映射,但是出了点问题:

es = Elasticsearch("localhost:9200")
request_body = {
    "settings": {
        "number_of_shards": 5,
        "number_of_replicas": 1
    },
    'mappings': {
        'examplecase': {
            'properties': {
                'tbl_id': {'index': 'not_analyzed', 'type': 'string'},
                'texts': {'index': 'analyzed', 'type': 'string'},
            }
        }
    }
}
es.indices.create(index='example_index', body=request_body)
Run Code Online (Sandbox Code Playgroud)

它显示elasticsearch.exceptions.RequestError: RequestError(400, 'mapper_parsing_exception', 'No handler for type [string] declared on field [texts]'),我找到了一些他们说的解决方案:使用text而不是string在字段类型中,但它也出错了:elasticsearch.exceptions.RequestError: RequestError(400, 'mapper_parsing_exception', 'Failed to parse mapping [examplecase]: Could not convert [texts.index] to boolean'). The elasticsearch version iselasticsearch-6.5.4. How can I deal …

python elasticsearch

2
推荐指数
1
解决办法
1万
查看次数

标签 统计

elasticsearch ×1

python ×1