elasticsearch - Elastic 7.X Root 映射定义包含不受支持的参数

标签 elasticsearch

从 6.X 升级到 7.X 后

我在索引创建中遇到下一个错误

RequestError(400, 'mapper_parsing_exception', 
'Root mapping definition has unsupported parameters:  
       [speechanalytics-transcript : {
               properties={
                 transcript_operator={similarity=scripted_tfidf, type=text}}]')

查询正文是
{
        'settings': {
            'similarity': {
                'scripted_tfidf': {
                    'type': 'scripted',
                    'script': {'source': 'double tf = doc.freq; return query.boost * tf;'},
                },
            },
        },
        'mappings': {
            'speechanalytics-transcript': {
             'properties': {
               'transcript_operator':{
                  'type': 'text',
                  'analyzer': 'standard',
                 'similarity': 'scripted_tfidf',
               }
              }
           }
        }
    }

最佳答案

在新版本中删除了映射类型
https://www.elastic.co/guide/en/elasticsearch/reference/6.7/removal-of-types.html

需要改变映射

    'mappings': {
        'speechanalytics-transcript': {
         'properties': {
           'transcript_operator':{
              'type': 'text',
              'analyzer': 'standard',
             'similarity': 'scripted_tfidf',
           }
          }
       }
    }


    'mappings': {
         'properties': {
           'transcript_operator':{
              'type': 'text',
              'analyzer': 'standard',
             'similarity': 'scripted_tfidf',
           }
        }
    }

关于elasticsearch - Elastic 7.X Root 映射定义包含不受支持的参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58643544/

相关文章:

ruby-on-rails - 如何使用耐嚼的 gem 使用Elasticsearch滚动API?

c# - 如何创建一个可以从多个数据源提取数据的 IQueryable Web API?

elasticsearch - Elasticsearch查询问题-[范围]格式错误的查询,预期[END_OBJECT],但发现[FIELD_NAME]

elasticsearch - 列出ElasticSearch中聚合的所有术语

ElasticSearch 不会排序

mongodb - 在 kibana 的 elasticsearch 中有一个 not_analyzed 字段

exception - 为什么我的 elasticsearch 无法在 JAVA API 中构建 transportclient?

elasticsearch - 限制聚合处理的结果数量

elasticsearch - 使用按查询删除从ElasticSearch删除200k +文档

algorithm - Elasticsearch 文档 View 数