Multiple wildcards in one query in elasticsearch

curl, elasticsearch, parseexception

Solution

Maybe something like this?

{
  "query": {
    "bool": {
      "must": [
        {
          "wildcard": {
            "_all": {
              "value": "*pet*"
            }
          }
        },
        {
          "wildcard": {
            "_all": {
              "value": "*rom*"
            }
          }
        }
      ]
    }
  }
}

Problem

``` curl localhost:9200/tweet/posts/_search -d '{ "query": { "and": [ { "wildcard": { "_all": "*pet*" } }, { "wildcard": { "_all": "*rom*" } } ] } }' ``` This gives me a parse exception. I want to run a MySQL `like(%test%)` type query with an AND condition. Is there any other good way to do in elasticsearch.

Original source