# Regex + simple word match

**URL:** https://discuss.elastic.co/t/regex-simple-word-match/21500
**Category:** Elasticsearch
**Created:** [January 6, 2015, 8:44am UTC](https://discuss.elastic.co/t/regex-simple-word-match/21500 "2015-01-06T08:44:23Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Amit\_4](https://avatars.discourse-cdn.com/v4/letter/a/ba8739/32.png) [@Amit\_4](https://discuss.elastic.co/u/Amit_4)
#### Post date: [January 6, 2015, 8:44am UTC](https://discuss.elastic.co/t/regex-simple-word-match/21500/1 "2015-01-06T08:44:23Z")

</div>

The default analyzer is standard. If I change it to keyword I can get regex  
working. But I want both to work simultaneously.  
For ex, Lets say I push this event to elasticsearch via logstash "this is  
my new string".  
In kibana search,  
If I look for message:"string", it should return me "this is my new string"  
If I look for message:"this.\*string", it should return me "this is my new  
string"

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/319ff9fa-af2b-481f-8124-824dab9df91b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/319ff9fa-af2b-481f-8124-824dab9df91b%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![radu\_gheorghe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/radu_gheorghe/32/556_2.png) [@radu\_gheorghe](https://discuss.elastic.co/u/radu_gheorghe)
#### Post date: [January 7, 2015, 12:27pm UTC](https://discuss.elastic.co/t/regex-simple-word-match/21500/2 "2015-01-07T12:27:02Z")

</div>

Hi Amit,

You'll probably need to use a multi field  
[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/\_multi\_fields.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/_multi_fields.html)  
(one with standard analyzer, one with keyword analyzer). This should return  
the string on:

message:"string"

and

message.raw:"this.\*string"

## Best regards, Radu

Performance Monitoring \* Log Analytics \* Search Analytics  
Solr & Elasticsearch Support \* [http://sematext.com/](http://sematext.com/)

On Tue, Jan 6, 2015 at 10:44 AM, Amit [amit.balode@gmail.com](mailto:amit.balode@gmail.com) wrote:

> The default analyzer is standard. If I change it to keyword I can get  
> regex  
> working. But I want both to work simultaneously.  
> For ex, Lets say I push this event to elasticsearch via logstash "this is  
> my  
> new string".  
> In kibana search,  
> If I look for message:"string", it should return me "this is my new  
> string"  
> If I look for message:"this.\*string", it should return me "this is my new  
> string"
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit

> **[Google Groups](https://groups.google.com/access-error?continue=https:%2F%2Fgroups.google.com%2Fg%2Felasticsearch%2Fc%2F319ff9fa-af2b-481f-8124-824dab9df91b@googlegroups.com)**

.

> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAHXA0\_1qaAWH08Q%2B36FYqmNJp\_1A50MG3\_-D8hPZMCRyeB08TA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAHXA0_1qaAWH08Q%2B36FYqmNJp_1A50MG3_-D8hPZMCRyeB08TA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 12:40am UTC](https://discuss.elastic.co/t/regex-simple-word-match/21500/3 "2017-07-06T00:40:19Z")

</div>


