# Elasticsearch mapping fields in python script gives error as "unsupported parameters"

**URL:** <https://discuss.elastic.co/t/elasticsearch-mapping-fields-in-python-script-gives-error-as-unsupported-parameters/130824>\
**Category:** Elasticsearch\
**Created:** [May 7, 2018, 11:21am UTC](https://discuss.elastic.co/t/elasticsearch-mapping-fields-in-python-script-gives-error-as-unsupported-parameters/130824 "2018-05-07T11:21:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tushar\_raut](https://avatars.discourse-cdn.com/v4/letter/t/48db29/32.png) [@tushar\_raut](https://discuss.elastic.co/u/tushar_raut)\
**Post date:** [May 7, 2018, 11:21am UTC](https://discuss.elastic.co/t/elasticsearch-mapping-fields-in-python-script-gives-error-as-unsupported-parameters/130824/1 "2018-05-07T11:21:43Z")

</div>

Mapping configuration are as follows:

```auto
es_mapping = {
            'properties': {
                'university': {
                    'type': 'object',
                    'properties': {
                        'name': {'type': 'text'},
                    }
                },
                'first_name': {'type': 'text'},
                'last_name': {'type': 'text'},
                'age': {'type': 'short'},
                'year_in_school': {'type': 'text'},
                'name_complete': {
                    'type': 'completion', # you have to make a method for completition for sure!
                    'analyzer': 'simple',
                    'payloads': True, # note that we have to provide payload while updating
                    'preserve_separators': True,
                    'preserve_position_increments': True,
                    'max_input_length': 50,
                },
                "course_names": {
                    "type": "text", 
                },
            }

```

Using above mapping when script is getting executed it gives following error:  
Error:  
elasticsearch.exceptions.RequestError: TransportError(400, u'mapper\_parsing\_exception', u'Mapping definition for [name\_complete] has unsupported parameters: [payloads : true]')

By commenting this mapping I tried to run script but it fails while loading data with the following error:  
u'error': {u'caused\_by': {u'reason': u'unknown field name [payload], must be one of [input, weight, contexts]', u'type': u'illegal\_argument\_exception'}, u'reason': u'failed to parse', u'type': u'mapper\_parsing\_exception'}

---

<div class="post-metadata">

**Author:** ![danielmitterdorfer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielmitterdorfer/32/110510_2.png) [@danielmitterdorfer](https://discuss.elastic.co/u/danielmitterdorfer)\
**Post date:** [May 11, 2018, 9:17am UTC](https://discuss.elastic.co/t/elasticsearch-mapping-fields-in-python-script-gives-error-as-unsupported-parameters/130824/2 "2018-05-11T09:17:45Z")

</div>

Hi,

_a general tip with the forum: please enclose code snippets in "```" otherwise the snippet is very hard to read. I edited your question so it is properly formatted._

You define the `name_complete` field to be used with a completion suggester, however you are using an unsupported parameter `payloads` (see [docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters-completion.html)) so the fix is to remove that parameter.

Daniel

---

<div class="post-metadata">

**Author:** ![tushar\_raut](https://avatars.discourse-cdn.com/v4/letter/t/48db29/32.png) [@tushar\_raut](https://discuss.elastic.co/u/tushar_raut)\
**Post date:** [May 11, 2018, 9:31am UTC](https://discuss.elastic.co/t/elasticsearch-mapping-fields-in-python-script-gives-error-as-unsupported-parameters/130824/3 "2018-05-11T09:31:51Z")

</div>

Got it, Thank you Daniel.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 8, 2018, 9:31am UTC](https://discuss.elastic.co/t/elasticsearch-mapping-fields-in-python-script-gives-error-as-unsupported-parameters/130824/4 "2018-06-08T09:31:59Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
