# Not able to make a search query match\_all after I cahnged my field mapping

**URL:** <https://discuss.elastic.co/t/not-able-to-make-a-search-query-match-all-after-i-cahnged-my-field-mapping/147738>\
**Category:** Elasticsearch\
**Created:** [September 7, 2018, 3:03pm UTC](https://discuss.elastic.co/t/not-able-to-make-a-search-query-match-all-after-i-cahnged-my-field-mapping/147738 "2018-09-07T15:03:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chitresh\_jain](https://avatars.discourse-cdn.com/v4/letter/c/46a35a/32.png) [@chitresh\_jain](https://discuss.elastic.co/u/chitresh_jain)\
**Post date:** [September 7, 2018, 3:03pm UTC](https://discuss.elastic.co/t/not-able-to-make-a-search-query-match-all-after-i-cahnged-my-field-mapping/147738/1 "2018-09-07T15:03:18Z")

</div>

Hello,

I have a field named "candidate\_name". Initially, I had a mapping for this field like this -

"candidate\_name" : {  
"type" : "text",  
"fields" : {  
"keyword" : {  
"type" : "keyword",  
"ignore\_above" : 256  
}  
}  
}

Now, I changed its mapping because I wanted to use completion Suggestor for this field -

This is how I defined it -  
{  
"mappings": {  
"doc": {  
"properties": {  
"candidate\_name": {  
"type": "completion",  
"analyzer": "simple",  
"search\_analyzer": "simple"  
}  
}  
}  
}  
}

After applying this mapping to this field, I am not able to make a search query like this -

client.search(  
{  
index : "candidates",  
body: {  
query: {  
multi\_match: {  
query: "chitresh"  
}  
}  
}  
)  
I was able to make this query before ad get the result.

So, how to define its mapping, so that I can use completion suggestor for this field as well as I can make a search query for this field.

I have already gone through ES docs. Couldn't get the solution there.

---

<div class="post-metadata">

**Author:** ![jaddison](https://avatars.discourse-cdn.com/v4/letter/j/e5b9ba/32.png) [@jaddison](https://discuss.elastic.co/u/jaddison)\
**Post date:** [September 27, 2018, 5:26pm UTC](https://discuss.elastic.co/t/not-able-to-make-a-search-query-match-all-after-i-cahnged-my-field-mapping/147738/2 "2018-09-27T17:26:50Z")

</div>

[Use subfields](https://www.elastic.co/guide/en/elasticsearch/reference/current/multi-fields.html). You were previously using them in your original example, you just need to add the completion subfield, I think?

```auto
{
  "candidate_name" : {
    "type" : "text",
    "fields" : {
      "keyword" : {
        "type" : "keyword",
        "ignore_above" : 256
      },
      "completion": {
        "type": "completion",
        "analyzer": "simple",
        "search_analyzer": "simple"
      }
    }
  }
}

```

Side note: it's always easier to get help if you've properly formatting your code/question.

---

<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:** [October 25, 2018, 5:26pm UTC](https://discuss.elastic.co/t/not-able-to-make-a-search-query-match-all-after-i-cahnged-my-field-mapping/147738/3 "2018-10-25T17:26:58Z")

</div>

Closed on October 25, 2018, 5:26pm UTC

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