# Having problem while searching the two words "One Two", do i Need mapping for it

**URL:** <https://discuss.elastic.co/t/having-problem-while-searching-the-two-words-one-two-do-i-need-mapping-for-it/5488>\
**Category:** Elasticsearch\
**Created:** [September 30, 2011, 11:12am UTC](https://discuss.elastic.co/t/having-problem-while-searching-the-two-words-one-two-do-i-need-mapping-for-it/5488 "2011-09-30T11:12:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chetansharma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chetansharma/32/3119_2.png) [@chetansharma](https://discuss.elastic.co/u/chetansharma)\
**Post date:** [September 30, 2011, 11:12am UTC](https://discuss.elastic.co/t/having-problem-while-searching-the-two-words-one-two-do-i-need-mapping-for-it/5488/1 "2011-09-30T11:12:59Z")

</div>

$query = new Elastica\_Query\_Wildcard('title', $term . '\*');  
$query\_ = new Elastica\_Query($query);  
$query\_-\>setLimit($json['limit']);  
$query\_-\>setFrom($json['offset']);  
$result\_set = $search\_type-\>search($query\_);

This is what i am i using to get the results form the ElasticSearch, but it  
works until there is no WhiteSpace in $term like "O", "On", "One"

but as soon I add next word, nothing is searched at all that is "One T"

I have tried the TextQuery as well

$query = new Elastica\_Query\_Text();  
$query-\>setField('title', $term);

$query\_ = new Elastica\_Query($query);  
$query\_-\>setLimit($json['limit']);  
$query\_-\>setFrom($json['offset']);  
$result\_set = $search\_type-\>search($query\_);

Can someone please help.

Actually need to implement Autocomplete feature , but i don't have core  
knowledge of ElasticSearch, working on the Upper layer with PHP Only. I have  
heared I need to do Mapping for my content, what exactly does that mean,  
didn't find any good document for this.

Thanks, any help will be much appreciated.

Thanks

---

<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, 3:53am UTC](https://discuss.elastic.co/t/having-problem-while-searching-the-two-words-one-two-do-i-need-mapping-for-it/5488/2 "2017-07-06T03:53:16Z")

</div>

Closed on July 6, 2017, 3:53am UTC


