# \[ES 2.4.4\] multi\_field type and completion suggester

**URL:** <https://discuss.elastic.co/t/es-2-4-4-multi-field-type-and-completion-suggester/83876>\
**Category:** Elasticsearch\
**Created:** [April 27, 2017, 2:02pm UTC](https://discuss.elastic.co/t/es-2-4-4-multi-field-type-and-completion-suggester/83876 "2017-04-27T14:02:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sreenadhsr](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@sreenadhsr](https://discuss.elastic.co/u/sreenadhsr)\
**Post date:** [April 27, 2017, 2:02pm UTC](https://discuss.elastic.co/t/es-2-4-4-multi-field-type-and-completion-suggester/83876/1 "2017-04-27T14:02:13Z")

</div>

**Elasticsearch version** : ES 2.4.4

**Plugins installed** : [None]

**JVM version** : Java(TM) SE Runtime Environment (build 1.8.0\_77-b03)

**OS version** : Red Hat Enterprise Linux Server release 6.7 (Santiago) - 2.6.32-642.15.1.el6.x86\_64

**Description of the problem including expected versus actual behavior** :

I am working on an elasticsearch upgrade project. (From version 0.90.11 to 2.4.4)

I am facing issue with _multi\_field_ type and _completion_ suggester.

A _multi\_field_ type with one field of type _completion_ is getting mapped differently in version 2.4.4.

e.g.: ES 0.90.11

```auto
{
    "test_index": {
        "item": {
            "properties": {
                "state": {
                    "type": "multi_field",
                    "fields": {
                        "suggest": {
                            "type": "completion",
                            "analyzer": "whitespace",
                            "payloads": false,
                            "preserve_separators": true,
                            "preserve_position_increments": true,
                            "max_input_len": 50
                        }
                    }
                }
            }
        }
    }
}

```

e.g.: ES 2.4.4

```auto
{
    "test_index": {
        "mappings": {
            "item": {
                "properties": {
                    "state": {
                        "type": "completion",
                        "analyzer": "simple",
                        "payloads": false,
                        "preserve_separators": true,
                        "preserve_position_increments": true,
                        "max_input_length": 50,
                        "fields": {
                            "suggest": {
                                "type": "completion",
                                "analyzer": "whitespace",
                                "payloads": false,
                                "preserve_separators": true,
                                "preserve_position_increments": true,
                                "max_input_length": 50
                            }
                        }
                    }
                }
            }
        }
    }
}

```

ES version 2.4.4 automatically map ‘_ **state** _’ property as _completion_ type and default to _ **simple** _ analyzer.

**Questions**

- Is this the expected behavior?

- What are the benefits of having ' **_fields_**' in Completion type?  
With the above mapping how the indexing work for input

```auto
PUT test_index/item/1
{
  "state": {
    "input": ["NC", "North Carolina"],
    "output": "North Carolina"
  }
}

```

- Is there any way I can retain the 0.90.11 search behavior in 2.4.4. So that I can keep using the same DSL?

```auto
POST test_index/_suggest
{
  "stateNameSuggest": {
    "text": "NC",
    "completion": {
      "field": "state.suggest"
    }
  }
}

```

**Steps to reproduce** :

1. Create Index

```auto
POST test_index
{
  "mappings": {
    "item": {
      "properties": {
        "state": {
          "type": "multi_field",
          "fields": {
            "suggest": {
              "type": "completion",
              "analyzer": "whitespace",
              "search_analyzer": "whitespace"
            }
          }
        }
      }
    }
  }
}

```

1. Load test data

```auto
PUT test_index/item/1
{
  "state": {
    "input": ["NC", "North Carolina"],
    "output": "North Carolina"
  }
}

```

1. Test - Completion Suggestion  
(Works in 0.90.11 but not in 2.4.4)

```auto
POST test_index/_suggest
{
  "stateNameSuggest": {
    "text": "NC",
    "completion": {
      "field": "state.suggest"
    }
  }
}

```

---

<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:** [May 25, 2017, 2:16pm UTC](https://discuss.elastic.co/t/es-2-4-4-multi-field-type-and-completion-suggester/83876/2 "2017-05-25T14:16:26Z")

</div>

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