# Get values with specific characters

**URL:** <https://discuss.elastic.co/t/get-values-with-specific-characters/60731>\
**Category:** Elasticsearch\
**Created:** [September 16, 2016, 3:55pm UTC](https://discuss.elastic.co/t/get-values-with-specific-characters/60731 "2016-09-16T15:55:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![prasad\_kp](https://avatars.discourse-cdn.com/v4/letter/p/dc4da7/32.png) [@prasad\_kp](https://discuss.elastic.co/u/prasad_kp)\
**Post date:** [September 16, 2016, 3:55pm UTC](https://discuss.elastic.co/t/get-values-with-specific-characters/60731/1 "2016-09-16T15:55:16Z")

</div>

Hi Team,

how to get the matches in the index with specific words..

Actually i have polyurethane in my elastic search ,

I want to get this word in otput if the user types more than two words in search box ..

If he types pol i want polyurethane to populate

M using the following code ,how i need to modify my code

//QueryBuilder builder = new QueryBuilder();  
final TimeValue timeValue = TimeValue.timeValueMillis(10000);

```
	try {
		
		// getting suggestion for SAYT search term
		CompletionSuggestionBuilder suggestionsBuilder = new CompletionSuggestionBuilder("complete");
		suggestionsBuilder.text(queryTerm);
		//JSONArray blackListArr = new JSONArray();
		suggestionsBuilder.field("autocomplete");		
		builder.must(QueryBuilders.matchQuery("suggestion", queryTerm).operator(MatchQueryBuilder.Operator.AND).fuzziness(Fuzziness.ONE));
		//builder.must(QueryBuilders.queryStringQuery(queryTerm).field("suggestion").fuzziness(fuzzinessValue));
		SearchRequestBuilder srb = ClientInstance.getInstance().getClient().prepareSearch(index).setTypes(type).setTimeout(timeValue).setQuery(builder);
		
		//.addSuggestion(suggestionsBuilder);
		srb.setSize(15);
		SearchHits hitss = null;
		SearchHit hittss = null;
		SearchHits totalhitss = null;
		SearchResponse response = srb.execute().actionGet();
		total = response.getHits().getTotalHits();
```

---

<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, 10:19pm UTC](https://discuss.elastic.co/t/get-values-with-specific-characters/60731/2 "2017-07-05T22:19:33Z")

</div>

Closed on July 5, 2017, 10:19pm UTC


