# How to support wild card search and prefix search in single QueryBuilder

**URL:** <https://discuss.elastic.co/t/how-to-support-wild-card-search-and-prefix-search-in-single-querybuilder/14065>\
**Category:** Elasticsearch\
**Created:** [October 23, 2013, 7:32am UTC](https://discuss.elastic.co/t/how-to-support-wild-card-search-and-prefix-search-in-single-querybuilder/14065 "2013-10-23T07:32:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sowjanya](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@sowjanya](https://discuss.elastic.co/u/sowjanya)\
**Post date:** [October 23, 2013, 7:32am UTC](https://discuss.elastic.co/t/how-to-support-wild-card-search-and-prefix-search-in-single-querybuilder/14065/1 "2013-10-23T07:32:59Z")

</div>

How to support wild card search and prefix search in single QueryBuilder.  
I used the matchPhrasePrefixQuery() it supporting only Prefix Search.  
I tried with another one that if filedQuery(). It working as expected.It supporting both prefix and wild card search. but if the data contains special symbols its not working.

I'am using the Standard Analyzer.  
Template is :  
{  
"sfdc\_template" : {  
"template" : "\*",  
"order": 0,  
"settings" :{

```
	},
	"mappings" : {
		"_default_" : {
			"_source" : {"enabled" : true },
			"_all" : {"enabled" : false },
			"_timestamp" : {"enabled" : true, "store" : "yes"},
			"sfdc_record_id" : {"type" : "string", "store" : "yes", "index" : "not_analyzed"},
			"sfdc_object_name" : {"type" : "string", "store" : "yes", "index" : "not_analyzed"},
			"sfdc_field_name" : {"type" : "string", "store" : "yes", "index" : "not_analyzed"}
		}
	}
}

```

}

---

<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 6, 2017, 2:11am UTC](https://discuss.elastic.co/t/how-to-support-wild-card-search-and-prefix-search-in-single-querybuilder/14065/2 "2017-07-06T02:11:04Z")

</div>

Closed on July 6, 2017, 2:11am UTC


