# Search for only numbers match

**URL:** <https://discuss.elastic.co/t/search-for-only-numbers-match/106392>\
**Category:** Kibana\
**Created:** [November 5, 2017, 12:07am UTC](https://discuss.elastic.co/t/search-for-only-numbers-match/106392 "2017-11-05T00:07:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![elasticuser1](https://avatars.discourse-cdn.com/v4/letter/e/a3d4f5/32.png) [@elasticuser1](https://discuss.elastic.co/u/elasticuser1)\
**Post date:** [November 5, 2017, 12:07am UTC](https://discuss.elastic.co/t/search-for-only-numbers-match/106392/1 "2017-11-05T00:07:39Z")

</div>

Hi, I want to search for id with numbers only in Kibana discovery tab. I came up with below query but it's not returning hits as desired. I pasted the sample message also which is expected output. Thanks in advance.

Query: "/api/discover/v1/search" AND id=/[0-9]+/

Message: 2017-11-04T23:55:39.005766+00:00 host app web.18 - Tags: xapi ~ 172.17.128.1 [4/Nov/2017:23:55:38 +0000] 296 GET /api/discover/v1/search?id=28273&size=small&requestFacets=true&requestProducts=true&pathname=/shop/handbags-accessories/sale-clearance/Pageindex,Price/5,0.0%257C49.99&\_application=MEW&\_deviceType=PHONE&\_navigationType=BROWSE&_shoppingMode=SITE&regionCode=US HTTP/1.1 200 95436 [https://xxx.com/shop/handbags-accessories/sale-clearance/Pageindex,Price/5,0.0%7C49.99?id=28273&cm\_sp=c2\_3111US\_catsplash\_handbags-%26-sunglasses-](https://xxx.com/shop/handbags-accessories/sale-clearance/Pageindex,Price/5,0.0%257C49.99?id=28273&cm_sp=c2_3111US_catsplash_handbags-%26-sunglasses-)-row3-_-image\_handbag-sale-and-clearance%2C-great-savings-are-in-the-bag&edge=hybrid&parentcategoryname=handbags-accessories&categorystring=sale-clearance&parentCategoryName=handbags-accessories&categoryString=sale-clearance Mozilla/5.0 (iPad; CPU OS 11\_0\_3 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A432 Safari/604.1 online\_uid=12331603474 request\_id=0876570772d2-9799-c919-52c2-102490fc2731 -

---

<div class="post-metadata">

**Author:** ![Bargs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bargs/32/5429_2.png) [@Bargs](https://discuss.elastic.co/u/Bargs)\
**Post date:** [November 7, 2017, 12:54am UTC](https://discuss.elastic.co/t/search-for-only-numbers-match/106392/2 "2017-11-07T00:54:26Z")

</div>

Hi @elasticuser1

Have you extracted the id as a separate field prior to indexing, using a tool like logstash or ingest pipelines?

If so, I suspect the problem is that the string you're searching for has slashes, and the [standard analyzer](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-standard-analyzer.html) removes slashes. If you want to do an exact match on the URL you should extract it as a separate field at index time. By default you'll get a `keyword` version of each text field, so then you can run a query like `url.keyword:"/api/discover/v1/search"` which will find documents where the URL is _exactly_ that value instead of doing analysis on the value.

---

<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:** [December 5, 2017, 12:54am UTC](https://discuss.elastic.co/t/search-for-only-numbers-match/106392/3 "2017-12-05T00:54:35Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
