# Single digit numeric search not working

**URL:** <https://discuss.elastic.co/t/single-digit-numeric-search-not-working/5970>\
**Category:** Elasticsearch\
**Created:** [November 25, 2011, 10:23am UTC](https://discuss.elastic.co/t/single-digit-numeric-search-not-working/5970 "2011-11-25T10:23:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![narinder\_izap](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/narinder_izap/32/803_2.png) [@narinder\_izap](https://discuss.elastic.co/u/narinder_izap)\
**Post date:** [November 25, 2011, 10:23am UTC](https://discuss.elastic.co/t/single-digit-numeric-search-not-working/5970/1 "2011-11-25T10:23:55Z")

</div>

Hi there,  
I am searching on the zip field. and by default it is not  
analyzed. But while searching when I am entering first digit, request is  
passed to the server, but it gives no response. But as I enter the second  
the digit, it gives the response. I am using "keyword" analyzer at the  
search time.but even then, the same output. Can anyone please explain me,  
whats wrong with it, and how to solve this problem??

---

<div class="post-metadata">

**Author:** ![Kartavya](https://avatars.discourse-cdn.com/v4/letter/k/65b543/32.png) [@Kartavya](https://discuss.elastic.co/u/Kartavya)\
**Post date:** [November 25, 2011, 9:48pm UTC](https://discuss.elastic.co/t/single-digit-numeric-search-not-working/5970/2 "2011-11-25T21:48:50Z")

</div>

May I know the complete mapping for your index?

Regards,  
Pulkit Agrawal

On Fri, Nov 25, 2011 at 3:53 PM, Narinder Kaur [narinder.kaur@izap.in](mailto:narinder.kaur@izap.in) wrote:

> Hi there,  
> I am searching on the zip field. and by default it is not  
> analyzed. But while searching when I am entering first digit, request is  
> passed to the server, but it gives no response. But as I enter the second  
> the digit, it gives the response. I am using "keyword" analyzer at the  
> search time.but even then, the same output. Can anyone please explain me,  
> whats wrong with it, and how to solve this problem??

---

<div class="post-metadata">

**Author:** ![Karussell1](https://avatars.discourse-cdn.com/v4/letter/k/50afbb/32.png) [@Karussell1](https://discuss.elastic.co/u/Karussell1)\
**Post date:** [November 25, 2011, 11:40pm UTC](https://discuss.elastic.co/t/single-digit-numeric-search-not-working/5970/3 "2011-11-25T23:40:09Z")

</div>

so you get no response for 1 or 2 characters? You can append a  
wildcard (\*) but for faster execution you should use the (edge) n gram  
tokenizer.

Peter.

On 25 Nov., 11:23, Narinder Kaur [narinder.k...@izap.in](mailto:narinder.k...@izap.in) wrote:

> Hi there,  
> I am searching on the zip field. and by default it is not  
> analyzed. But while searching when I am entering first digit, request is  
> passed to the server, but it gives no response. But as I enter the second  
> the digit, it gives the response. I am using "keyword" analyzer at the  
> search time.but even then, the same output. Can anyone please explain me,  
> whats wrong with it, and how to solve this problem??

---

<div class="post-metadata">

**Author:** ![narinder\_izap](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/narinder_izap/32/803_2.png) [@narinder\_izap](https://discuss.elastic.co/u/narinder_izap)\
**Post date:** [November 26, 2011, 7:38am UTC](https://discuss.elastic.co/t/single-digit-numeric-search-not-working/5970/4 "2011-11-26T07:38:16Z")

</div>

its working on default mapping

---

<div class="post-metadata">

**Author:** ![narinder\_izap](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/narinder_izap/32/803_2.png) [@narinder\_izap](https://discuss.elastic.co/u/narinder_izap)\
**Post date:** [November 26, 2011, 7:39am UTC](https://discuss.elastic.co/t/single-digit-numeric-search-not-working/5970/5 "2011-11-26T07:39:16Z")

</div>

it is working for characters. but the problem is with the numeric values  
only, that too with the single digit, it start searching with two digits.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [November 27, 2011, 4:12pm UTC](https://discuss.elastic.co/t/single-digit-numeric-search-not-working/5970/6 "2011-11-27T16:12:53Z")

</div>

Is this a numeric field or a string / char based field? if you don't know  
what type you indexed it as, you can use the get mapping API to see what it  
ended up being.

What are you after exactly though, the question is quite vague. You want to  
do a prefix query on it?

On Sat, Nov 26, 2011 at 9:39 AM, Narinder Kaur [narinder.kaur@izap.in](mailto:narinder.kaur@izap.in)wrote:

> it is working for characters. but the problem is with the numeric values  
> only, that too with the single digit, it start searching with two digits.

---

<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:47am UTC](https://discuss.elastic.co/t/single-digit-numeric-search-not-working/5970/7 "2017-07-06T03:47:24Z")

</div>


