# Problem bringing string part in ElasticSearch

**URL:** https://discuss.elastic.co/t/problem-bringing-string-part-in-elasticsearch/319492
**Category:** Elasticsearch
**Created:** [November 21, 2022, 8:04pm UTC](https://discuss.elastic.co/t/problem-bringing-string-part-in-elasticsearch/319492 "2022-11-21T20:04:55Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Diego\_Souza](https://avatars.discourse-cdn.com/v4/letter/d/ecccb3/32.png) [@Diego\_Souza](https://discuss.elastic.co/u/Diego_Souza)
#### Post date: [November 21, 2022, 8:04pm UTC](https://discuss.elastic.co/t/problem-bringing-string-part-in-elasticsearch/319492/1 "2022-11-21T20:04:55Z")

</div>

I'm having a problem getting string part in Elasticsearch. Below is the configuration of index.

```auto
PUT exemplo
{
    "settings": {
    "analysis": {
      "analyzer": {
        "portuguese_br": {
          "type": "portuguese"
        }
      }
    }
  },
  "mappings": {
    "properties": {
      "id": {
        "type": "integer"
      },
      "content": {
        "type": "text",
        "analyzer": "portuguese_br"
      }
    }
  }
}

```

There is a document with the following content in the index "exemplo":

```auto
h2 style margin 0 0 8px font size 16px color 064a7a 1 Síntese Resumo Descrição do cliente h2 div id headertipodocumento1 style min height 40px position relative class editable mce content body contenteditable true spellcheck false p eu encaminho uma Carta ao ReI

```

I can't get the document with the following request:

```auto
GET exemplo/_search
{
  "from": 0,
  "size": 1,
  "query": {
    "bool": {
      "must": [
        {"regexp": {"content": ".*caminho.*"}}
      ]
    }
  }
}

```

There is a part of content with the word "encaminho". I'm searching for "caminho" and not getting any result.

Am I doing something wrong in regexp?

---

<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 19, 2022, 8:05pm UTC](https://discuss.elastic.co/t/problem-bringing-string-part-in-elasticsearch/319492/2 "2022-12-19T20:05:04Z")

</div>

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