Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Elastic 7.X Root mapping definition has unsupported parameters

After upgate from 6.X to 7.X

I got next error in index create

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

query body is

{
        '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',
               }
              }
           }
        }
    }
like image 528
Ryabchenko Alexander Avatar asked Sep 08 '25 10:09

Ryabchenko Alexander


1 Answers

In new version mapping type was removed https://www.elastic.co/guide/en/elasticsearch/reference/6.7/removal-of-types.html

need to change mapping

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

to

    'mappings': {
         'properties': {
           'transcript_operator':{
              'type': 'text',
              'analyzer': 'standard',
             'similarity': 'scripted_tfidf',
           }
        }
    }
like image 58
Ryabchenko Alexander Avatar answered Sep 10 '25 09:09

Ryabchenko Alexander