# Search a dot in string with wildcard

**URL:** <https://discuss.elastic.co/t/search-a-dot-in-string-with-wildcard/121823>\
**Category:** Elasticsearch\
**Created:** [February 28, 2018, 10:14am UTC](https://discuss.elastic.co/t/search-a-dot-in-string-with-wildcard/121823 "2018-02-28T10:14:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![michele](https://avatars.discourse-cdn.com/v4/letter/m/ed8c4c/32.png) [@michele](https://discuss.elastic.co/u/michele)\
**Post date:** [February 28, 2018, 10:14am UTC](https://discuss.elastic.co/t/search-a-dot-in-string-with-wildcard/121823/1 "2018-02-28T10:14:29Z")

</div>

In my index I have:

- doc1 ==\> field1 = foo 123, field2 = 123
- doc2 ==\> field1 = f.o.o 456, field2 = 456

If I do this query, I have returned doc1:

```
{
	"query":{
		"bool":{
			"must":[
				{"wildcard":{"field1" : "foo*"}},
				{"term":{"field2": "123"}}
				]
		}
	}
}

```

If I do this query, I have returned empty results:

```
{
	"query":{
		"bool":{
			"must":[
				{"wildcard":{"field1" : "*456"}},
				{"term":{"field2": "456"}}
				]
		}
	}
}

```

I have returned doc2.

If I do this query, I have returned empty results:

```
{
	"query":{
		"bool":{
			"must":[
				{"wildcard":{"field1" : "f.o.o*"}},
				{"term":{"field2": "456"}}
				]
		}
	}
}

```

I think that the problem is the dot character in field1.

How can I search with regex for finding string that has dot inside?

---

<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:** [February 28, 2018, 12:09pm UTC](https://discuss.elastic.co/t/search-a-dot-in-string-with-wildcard/121823/2 "2018-02-28T12:09:05Z")

</div>

It depends on the analyzer you are using for your field as wildcard query is not analyzed.

---

<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:** [March 28, 2018, 12:09pm UTC](https://discuss.elastic.co/t/search-a-dot-in-string-with-wildcard/121823/3 "2018-03-28T12:09:28Z")

</div>

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