# How Come match\_phrase does not work when "." present?

**URL:** <https://discuss.elastic.co/t/how-come-match-phrase-does-not-work-when-present/187079>\
**Category:** Elasticsearch\
**Created:** [June 24, 2019, 8:20am UTC](https://discuss.elastic.co/t/how-come-match-phrase-does-not-work-when-present/187079 "2019-06-24T08:20:34Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![initproto](https://avatars.discourse-cdn.com/v4/letter/i/74df32/32.png) [@initproto](https://discuss.elastic.co/u/initproto)\
**Post date:** [June 24, 2019, 8:20am UTC](https://discuss.elastic.co/t/how-come-match-phrase-does-not-work-when-present/187079/1 "2019-06-24T08:20:34Z")

</div>

I have a field called "name".

I run a match\_phrase with name query "17p13". It finds a record with exactly that name and another with "(del)17p13", but NOT one with "17p13.1".

"name" mapping is set to text.

This seems illogical.  
Is it broken?

---

<div class="post-metadata">

**Author:** ![initproto](https://avatars.discourse-cdn.com/v4/letter/i/74df32/32.png) [@initproto](https://discuss.elastic.co/u/initproto)\
**Post date:** [July 1, 2019, 2:04pm UTC](https://discuss.elastic.co/t/how-come-match-phrase-does-not-work-when-present/187079/2 "2019-07-01T14:04:06Z")

</div>

I guess this is bug. I will open a bug report.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 1, 2019, 3:27pm UTC](https://discuss.elastic.co/t/how-come-match-phrase-does-not-work-when-present/187079/3 "2019-07-01T15:27:50Z")

</div>

I don't think it is but it probably depends on the mapping and analyzer.

Could you provide a full recreation script as described in [About the Elasticsearch category](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). It will help to better understand what you are doing. Please, try to keep the example as simple as possible.

A full reproduction script will help readers to understand, reproduce and if needed fix your problem. It will also most likely help to get a faster answer.

---

<div class="post-metadata">

**Author:** ![initproto](https://avatars.discourse-cdn.com/v4/letter/i/74df32/32.png) [@initproto](https://discuss.elastic.co/u/initproto)\
**Post date:** [July 2, 2019, 11:33am UTC](https://discuss.elastic.co/t/how-come-match-phrase-does-not-work-when-present/187079/4 "2019-07-02T11:33:00Z")

</div>

Your testers should be able to check their test cases and add this condition. As the statement says, match\_phrase does not work when there is a dot in the value. Pretty straightforward situation. And it does not work at all.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 2, 2019, 11:57am UTC](https://discuss.elastic.co/t/how-come-match-phrase-does-not-work-when-present/187079/5 "2019-07-02T11:57:47Z")

</div>

Really up to you. I was just trying to help. If you don't need help to fix your queries or your mapping, that's fine. I can mark this thread as solved if you wish.

---

<div class="post-metadata">

**Author:** ![initproto](https://avatars.discourse-cdn.com/v4/letter/i/74df32/32.png) [@initproto](https://discuss.elastic.co/u/initproto)\
**Post date:** [July 2, 2019, 12:49pm UTC](https://discuss.elastic.co/t/how-come-match-phrase-does-not-work-when-present/187079/6 "2019-07-02T12:49:01Z")

</div>

Looks like it might be something with the mapping. A quick couple of curl commands shows it worked on a new index. I'm pretty sure the mappings for the tested field are the same between my populated index and the test index, so I guess this requires more digging. It's not obvious what is interfering with the search results here. Just thought I would bring it to list attention in case there is a known issue or other remedy.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 2, 2019, 1:08pm UTC](https://discuss.elastic.co/t/how-come-match-phrase-does-not-work-when-present/187079/7 "2019-07-02T13:08:39Z")

</div>

That's why I recommend sharing a full reproduction script. It helps you to reproduce or not the problem. If the later, then you can may be find by yourself the solution.

In either case, asking here with a full script will help us to understand and help you to fix the problem in the fastest way as possible.

---

<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 30, 2019, 1:08pm UTC](https://discuss.elastic.co/t/how-come-match-phrase-does-not-work-when-present/187079/8 "2019-07-30T13:08:41Z")

</div>

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