# Wildcard and phrase\_prefix in \_all field by multi\_match query

**URL:** <https://discuss.elastic.co/t/wildcard-and-phrase-prefix-in--all-field-by-multi-match-query/57476>\
**Category:** Elasticsearch\
**Created:** [August 8, 2016, 12:40pm UTC](https://discuss.elastic.co/t/wildcard-and-phrase-prefix-in--all-field-by-multi-match-query/57476 "2016-08-08T12:40:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![trex](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/trex/32/34230_2.png) [@trex](https://discuss.elastic.co/u/trex)\
**Post date:** [August 8, 2016, 12:40pm UTC](https://discuss.elastic.co/t/wildcard-and-phrase-prefix-in--all-field-by-multi-match-query/57476/1 "2016-08-08T12:40:41Z")

</div>

I want to match both by wildcard and phrase\_prefix in the \_all field. But the queries below don't work for me.

`{'query': {'multi_match': {'query': 'demen*', 'type': 'phrase_prefix', 'fields': ['_all']}}}`

`{'query': {'multi_match': {'query': 'demen', 'type': 'phrase_prefix', 'fields': ['_all']}}}`

The queries above work if I specify fileds.

`{'query': {'multi_match': {'query': 'demen*', 'type': 'phrase_prefix', 'fields': ['Diag', 'Text']}}}`

`{'query': {'multi_match': {'query': 'demen', 'type': 'phrase_prefix', 'fields': ['Diag', 'Text']}}}`

My mappings:

```
...
"type": {
  "_all": {
    "analyzer": "stem_analyzer"
  },
  "properties": {
    "field" : {
      "type": "string",
      "analyzer": "stem_analyzer"
    }
  }
}
...
"settings" : {
  "index" : {
    "creation_date" : "1470145125821",
    "analysis" : {
      "filter" : {
        "stem_possessive_filter" : {
          "name" : "possessive_english",
          "type" : "stemmer"
        }
      },
      "analyzer" : {
        "stem_analyzer" : {
          "filter" : ["standard", "lowercase", "stem_possessive_filter"],
          "tokenizer" : "standard"
        }
      }
    },
    "number_of_shards" : "5",
    "number_of_replicas" : "1",
    "uuid" : "vKKmroWnTtS7JCIz6Zk6Ew",
    "version" : {
      "created" : "2030399"
    }
  }
}

```

Why wildcard and phrase\_prefix don't work with the \_all field? How can I make them work?

---

<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 5, 2017, 10:29pm UTC](https://discuss.elastic.co/t/wildcard-and-phrase-prefix-in--all-field-by-multi-match-query/57476/2 "2017-07-05T22:29:25Z")

</div>


