# Elasticsearch 5.1.1 \_suggest not working with mapping

**URL:** <https://discuss.elastic.co/t/elasticsearch-5-1-1--suggest-not-working-with-mapping/73598>\
**Category:** Elasticsearch\
**Created:** [February 1, 2017, 11:33pm UTC](https://discuss.elastic.co/t/elasticsearch-5-1-1--suggest-not-working-with-mapping/73598 "2017-02-01T23:33:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shail\_Patel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shail_patel/32/15125_2.png) [@Shail\_Patel](https://discuss.elastic.co/u/Shail_Patel)\
**Post date:** [February 1, 2017, 11:33pm UTC](https://discuss.elastic.co/t/elasticsearch-5-1-1--suggest-not-working-with-mapping/73598/1 "2017-02-01T23:33:41Z")

</div>

Here is the mapping I have:

```
{
  "ft_autocomplete_v2" : {
    "mappings" : {
      "ft" : {
        "properties" : {
          "nameSuggest" : {
            "properties" : {
              "input" : {
                "type" : "text",
                "fields" : {
                  "keyword" : {
                    "type" : "keyword",
                    "ignore_above" : 256
                  }
                }
              },
              "output" : {
                "type" : "text",
                "fields" : {
                  "keyword" : {
                    "type" : "keyword",
                    "ignore_above" : 256
                  }
                }
              },
              "payload" : {
                "properties" : {
                  "address" : {
                    "type" : "text",
                    "fields" : {
                      "keyword" : {
                        "type" : "keyword",
                        "ignore_above" : 256
                      }
                    }
                  },
                  "city" : {
                    "type" : "text",
                    "fields" : {
                      "keyword" : {
                        "type" : "keyword",
                        "ignore_above" : 256
                      }
                    }
                  },
                  "uuid" : {
                    "type" : "text",
                    "fields" : {
                      "keyword" : {
                        "type" : "keyword",
                        "ignore_above" : 256
                      }
                    }
                  }
                }
              },
              "suggest" : {
                "type" : "completion",
                "analyzer" : "standard",
                "preserve_separators" : false,
                "preserve_position_increments" : false,
                "max_input_length" : 50
              },
              "weight" : {
                "type" : "long"
              }
            }
          }
        }
      }
    }
  }
}

```

Here is the request I'm making:

```
curl -X POST -H "Content-Type: application/json" -d '{
    "sample-suggest" : {
        "prefix" : "A",
        "completion" : {
            "field" : "nameSuggest"
        }
    }
}' "http://localhost:17769/places/foursquare_autocomplete_v2/_suggest?pretty"

```

Error:

```
{
  "error" : {
    "root_cause" : [
      {
        "type" : "illegal_argument_exception",
        "reason" : "no mapping found for field [nameSuggest]"
      }
    ],
    "type" : "search_phase_execution_exception",
    "reason" : "all shards failed",
    "phase" : "query",
    "grouped" : true,
    "failed_shards" : [
      {
        "shard" : 0,
        "index" : "ft_autocomplete_v2",
        "node" : "3-u2ZcPmQPiJYRAILIPQ_A",
        "reason" : {
          "type" : "illegal_argument_exception",
          "reason" : "no mapping found for field [nameSuggest]"
        }
      }
    ],
    "caused_by" : {
      "type" : "illegal_argument_exception",
      "reason" : "no mapping found for field [nameSuggest]"
    }
  },
  "status" : 400
}

```

I'm not sure why it is saying that nameSuggest doesn't have any mapping when it is defined? Or am I misunderstanding? The data in this index was migrated from ES 2.4.1. When I do a normally \_search query, I'm able to get data back, so it wasn't corrupted or anything.

---

<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:** [March 1, 2017, 11:34pm UTC](https://discuss.elastic.co/t/elasticsearch-5-1-1--suggest-not-working-with-mapping/73598/2 "2017-03-01T23:34:57Z")

</div>

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