# Nesting regexp and match

**URL:** <https://discuss.elastic.co/t/nesting-regexp-and-match/36851>\
**Category:** Elasticsearch\
**Created:** [December 10, 2015, 9:27am UTC](https://discuss.elastic.co/t/nesting-regexp-and-match/36851 "2015-12-10T09:27:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deep\_Pradhan](https://avatars.discourse-cdn.com/v4/letter/d/f6c823/32.png) [@Deep\_Pradhan](https://discuss.elastic.co/u/Deep_Pradhan)\
**Post date:** [December 10, 2015, 9:27am UTC](https://discuss.elastic.co/t/nesting-regexp-and-match/36851/1 "2015-12-10T09:27:50Z")

</div>

Hi All,  
I want to use elastic search queries to design a search engine wherein if I type a letter it should throw me all the possible name starting with the letter and as I type other letters the search should be refined.  
I have written this query but it gives me only the names which exactly match the one that I pass in the query. Could anyone help me with this?  
{  
"query": {  
"bool": {  
"must": [{  
"match": {  
"name": "Robert"  
}  
},

```
			{
				"match": {
					"name": "M"
				}
			}, {
				"match": {
					"name": "Generio"
				}
			}
		]
	}
}

```

}

Thank You

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 10, 2015, 9:43am UTC](https://discuss.elastic.co/t/nesting-regexp-and-match/36851/2 "2015-12-10T09:43:09Z")

</div>

You can look at:

- [https://www.elastic.co/guide/en/elasticsearch/guide/current/\_ngrams\_for\_partial\_matching.html?q=ngrams](https://www.elastic.co/guide/en/elasticsearch/guide/current/_ngrams_for_partial_matching.html?q=ngrams)
- [https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html?q=suggestion%20definiti](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html?q=suggestion%20definiti)

---

<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 5, 2017, 11:32pm UTC](https://discuss.elastic.co/t/nesting-regexp-and-match/36851/3 "2017-07-05T23:32:04Z")

</div>


