# Bug in standard analyzer?

**URL:** <https://discuss.elastic.co/t/bug-in-standard-analyzer/242010>\
**Category:** Elasticsearch\
**Created:** [July 21, 2020, 10:51am UTC](https://discuss.elastic.co/t/bug-in-standard-analyzer/242010 "2020-07-21T10:51:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![corbosman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/corbosman/32/62787_2.png) [@corbosman](https://discuss.elastic.co/u/corbosman)\
**Post date:** [July 21, 2020, 10:51am UTC](https://discuss.elastic.co/t/bug-in-standard-analyzer/242010/1 "2020-07-21T10:51:27Z")

</div>

Hi all, we have a field that contains hostnames like "[foo.bar.com](http://foo.bar.com)". I noticed that when I searched for hostnames with only digits, I got too many results. Let's say I search for "[1234.example.com](http://1234.example.com)", I would also get back all results for [example.com](http://example.com). But this didnt happen if the subdomain is alpha, like [foo.example.com](http://foo.example.com). The search analyzer defaults to the standard analyzer, which tells me:

```auto
{
  "tokens" : [
    {
      "token" : "1234",
      "start_offset" : 0,
      "end_offset" : 5,
      "type" : "<NUM>",
      "position" : 0
    },
    {
      "token" : "example.com",
      "start_offset" : 6,
      "end_offset" : 17,
      "type" : "<ALPHANUM>",
      "position" : 1
    }
  ]
}

```

This seems logical, but then I noticed the type for the second token is ALPHANUM, and surely 1234 is also ALPHANUM and so is the whole [1234.example.com](http://1234.example.com). So why did it get split into 2 tokens?

---

<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:** [August 18, 2020, 11:06am UTC](https://discuss.elastic.co/t/bug-in-standard-analyzer/242010/2 "2020-08-18T11:06:46Z")

</div>

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