# Regexp/wildcard with slash in data does not work (ES 5.0)

**URL:** <https://discuss.elastic.co/t/regexp-wildcard-with-slash-in-data-does-not-work-es-5-0/67638>\
**Category:** Elasticsearch\
**Created:** [November 30, 2016, 3:14pm UTC](https://discuss.elastic.co/t/regexp-wildcard-with-slash-in-data-does-not-work-es-5-0/67638 "2016-11-30T15:14:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karl\_Vesterling](https://avatars.discourse-cdn.com/v4/letter/k/eb9ed0/32.png) [@Karl\_Vesterling](https://discuss.elastic.co/u/Karl_Vesterling)\
**Post date:** [November 30, 2016, 3:14pm UTC](https://discuss.elastic.co/t/regexp-wildcard-with-slash-in-data-does-not-work-es-5-0/67638/1 "2016-11-30T15:14:01Z")

</div>

Created the index as follows:  
--begin--  
PUT testdeviceports  
{  
"mappings": {  
"portinfo": {  
"properties": {  
"hostname": {  
"type": "text",  
"fields": {  
"keyword": {  
"type": "keyword"  
}  
}  
},  
"Name": {  
"type": "text",  
"fields": {  
"keyword": {  
"type": "keyword"  
}  
}  
}  
}  
}  
}  
}  
--end--

Keyword is the type, and from what I've read, that should be right.

Now, when I query for something with a slash in the data with a wildcard or a regex in Kibana, I get NO results...

Name: GigabitEthernet1/\*  
None...

Name.keword: GigabitEthernet1/\*  
None

Name: GigabitEthernet1/\*  
None...

Name.keword: GigabitEthernet1/\*  
None

Leave off the slash, and query for:  
Name: GigabitEthernet\*

And I get LOADS of results...

Read the docs, and I'm either missing something, or this is indeed a bug. Came across another post where someone said they got it to work by escaping the / with FOUR 's... Still no joy...

ES 5.0 with X-Pack Centos 7

---

<div class="post-metadata">

**Author:** ![Karl\_Vesterling](https://avatars.discourse-cdn.com/v4/letter/k/eb9ed0/32.png) [@Karl\_Vesterling](https://discuss.elastic.co/u/Karl_Vesterling)\
**Post date:** [November 30, 2016, 8:01pm UTC](https://discuss.elastic.co/t/regexp-wildcard-with-slash-in-data-does-not-work-es-5-0/67638/2 "2016-11-30T20:01:50Z")

</div>

Weird... Just weird...

So I created this mapping:  
{  
"properties": {  
"hostname": {  
"type": "text",  
"analyzer": "whitespace",  
"fielddata": true  
},  
"Name": {  
"type": "text",  
"analyzer": "whitespace",  
"fielddata": true  
}  
}  
}

hostname I can search with a regex... Up to any special character.

HOWEVER... Name I cannot search... NONE... As a matter of fact, ANY field with a '/' in it, is unsearchable with the mapping above.

This is entirely un-intuitive... Someone needs to document the expected behavior of regex with the different analyzers... This is entirely unexpected.

---

<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 28, 2016, 8:02pm UTC](https://discuss.elastic.co/t/regexp-wildcard-with-slash-in-data-does-not-work-es-5-0/67638/3 "2016-12-28T20:02:01Z")

</div>

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