Problem bringing string part in ElasticSearch

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

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":

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:

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?

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