# Search like Regex

**URL:** <https://discuss.elastic.co/t/search-like-regex/137093>\
**Category:** Elasticsearch\
**Created:** [June 22, 2018, 10:45pm UTC](https://discuss.elastic.co/t/search-like-regex/137093 "2018-06-22T22:45:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Naruhodou](https://avatars.discourse-cdn.com/v4/letter/n/7feea3/32.png) [@Naruhodou](https://discuss.elastic.co/u/Naruhodou)\
**Post date:** [June 22, 2018, 10:45pm UTC](https://discuss.elastic.co/t/search-like-regex/137093/1 "2018-06-22T22:45:41Z")

</div>

Hi, I have a field called message and the content look like this.

```auto
"Add: , Delete: 1" (This means no entity is added and entity 1 is deleted)
"Add: 1, Delete: 2"
"Add: 3, 4, Delete: "

```

How can I search for all the results in which some entities are deleted? In other words, there is some number after "Delete: ".

Thanks!

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [June 23, 2018, 6:36am UTC](https://discuss.elastic.co/t/search-like-regex/137093/2 "2018-06-23T06:36:34Z")

</div>

You might be able to do it using a [scripted field](https://www.elastic.co/guide/en/elasticsearch/reference/6.3/search-request-script-fields.html), but this will probably be slow and not scale well. The better approach is to parse this out and store the relevant data in separate fields at ingest time.

---

<div class="post-metadata">

**Author:** ![Naruhodou](https://avatars.discourse-cdn.com/v4/letter/n/7feea3/32.png) [@Naruhodou](https://discuss.elastic.co/u/Naruhodou)\
**Post date:** [June 25, 2018, 10:49pm UTC](https://discuss.elastic.co/t/search-like-regex/137093/3 "2018-06-25T22:49:50Z")

</div>

Get it. Thanks!

---

<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 23, 2018, 11:03pm UTC](https://discuss.elastic.co/t/search-like-regex/137093/4 "2018-07-23T23:03:55Z")

</div>

Closed on July 23, 2018, 11:03pm UTC

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