# Search by full name

**URL:** <https://discuss.elastic.co/t/search-by-full-name/335960>\
**Category:** Elasticsearch\
**Created:** [June 14, 2023, 9:07am UTC](https://discuss.elastic.co/t/search-by-full-name/335960 "2023-06-14T09:07:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![orlenkoda5](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/orlenkoda5/32/117648_2.png) [@orlenkoda5](https://discuss.elastic.co/u/orlenkoda5)\
**Post date:** [June 14, 2023, 9:07am UTC](https://discuss.elastic.co/t/search-by-full-name/335960/1 "2023-06-14T09:07:53Z")

</div>

Hi everyone.

I have an index wich consists of 3 fields:  
sys\_name  
full\_name  
man\_id.

I want to search by full name wich consists of 3 words:

```auto
GET managers/_search
{
"query": {
"match": {
"full_name": "William Garvey Johnson"
}
}
}

```

but the result set have only one of the words above (Johnson).  
What query should I use to have a match of all three words of a full name?  
My mapping of an index:

```auto
PUT /managers
{
"settings": {
"index": {
"max_ngram_diff": 30
},
"analysis": {
"analyzer": {
"autocomplete": {
"tokenizer": "autocomplete",
"filter": [
"lowercase"
]
},
"autocomplete_search": {
"tokenizer": "standard",
"filter": [
"lowercase"
]
}
},
"tokenizer": {
"autocomplete": {
"type": "edge_ngram",
"min_gram": 1,
"max_gram": 30
}
}
}
},
"mappings": {
"properties": {
"man_id": {
"type": "long",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"sys_name": {
"type": "text",
"analyzer": "autocomplete",
"search_analyzer": "autocomplete_search",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"full_name": {
"type": "text",
"analyzer": "autocomplete",
"search_analyzer": "autocomplete_search"
}
}
}
}

```

---

<div class="post-metadata">

**Author:** ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)\
**Post date:** [June 14, 2023, 11:57am UTC](https://discuss.elastic.co/t/search-by-full-name/335960/2 "2023-06-14T11:57:40Z")

</div>

Hi @orlenkoda5 ,

Have you tried the [`match_phrase`](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query-phrase.html) query instead of `match` to see if that gives you what you need?

```auto
GET managers/_search
{
  "query": {
    "match_phrase": {
      "full_name": "William Garvey Johnson"
    }
  }
}

```

---

<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:** [July 12, 2023, 11:58am UTC](https://discuss.elastic.co/t/search-by-full-name/335960/3 "2023-07-12T11:58:33Z")

</div>

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