# Multi\_match query issue

**URL:** <https://discuss.elastic.co/t/multi-match-query-issue/136988>\
**Category:** Elasticsearch\
**Created:** [June 22, 2018, 8:23am UTC](https://discuss.elastic.co/t/multi-match-query-issue/136988 "2018-06-22T08:23:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohammedEssabri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mohammedessabri/32/42177_2.png) [@mohammedEssabri](https://discuss.elastic.co/u/mohammedEssabri)\
**Post date:** [June 22, 2018, 8:23am UTC](https://discuss.elastic.co/t/multi-match-query-issue/136988/1 "2018-06-22T08:23:52Z")

</div>

Hi Team,  
I'm using ES 1.7  
I have an index containing a field named proceedingslanguage which contains a language EN, FR or DE.

The following script using Curl is giving me an empty result :

```
curl -XGET 'http://localhost:9200/_search?pretty' -d'{
  "from" : 0,
  "size" : 6,
  "query" : {
    "filtered" : {
      "query" : {
        "bool" : {
          "must" : [ {
            "bool" : {
              "must" : {
                "multi_match" : {
                  "query" : "EN",
                  "fields" : ["proceedingslanguage_*", "proceedingslanguage_en^5.0"],
                  "type" : "best_fields"
                }
              }
            }
          } ]
        }
      },
      "filter" : {
        "type" : {
          "value" : "decision"
        }
      }
    }
  }
}'

```

**Note:** the same query is sending by Elasticsearch java client from an app to retrieve data by language.

The result is described below:

```
   {
      "took" : 10,
      "timed_out" : false,
      "_shards" : {
        "total" : 27,
        "successful" : 27,
        "failed" : 0
      },
      "hits" : {
        "total" : 0,
        "max_score" : null,
        "hits" : []
      }
    }

```

Can you please give me a hand of help?

Thanks and best regards,  
Mohammed ESSABRI

---

<div class="post-metadata">

**Author:** ![mayya](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mayya/32/83147_2.png) [@mayya](https://discuss.elastic.co/u/mayya)\
**Post date:** [June 29, 2018, 8:27pm UTC](https://discuss.elastic.co/t/multi-match-query-issue/136988/2 "2018-06-29T20:27:20Z")

</div>

> I'm using ES 7.1

The latest version of ES available is 6.3. Are you using a master branch?

It is not very clear: do you have a single field named `proceedingslanguage` that has values of `EN`, `FR`, `DE`? Or do you have different fields named: `proceedingslanguageEN`, `proceedingslanguageFR` etc?  
Also what are you trying to search for?

---

<div class="post-metadata">

**Author:** ![mohammedEssabri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mohammedessabri/32/42177_2.png) [@mohammedEssabri](https://discuss.elastic.co/u/mohammedEssabri)\
**Post date:** [July 1, 2018, 9:05pm UTC](https://discuss.elastic.co/t/multi-match-query-issue/136988/3 "2018-07-01T21:05:47Z")

</div>

Hi @mayya,

Thank you for you response!

Sorry, it is a mistake, i wanted to write 1.7.

For your question, it is a single field named proceedingslanguage that has values of EN, FR, DE. and the application was developed by another developer, and i don't understand why the app requires "proceedingslanguage\_\*" where we have only proceedingslanguage in mapping.

Note that the application was already working with this configuration more than 1 year and it's working currently in some environments.

Best regards,  
Mohammed ESSABRI

---

<div class="post-metadata">

**Author:** ![mayya](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mayya/32/83147_2.png) [@mayya](https://discuss.elastic.co/u/mayya)\
**Post date:** [July 4, 2018, 12:19pm UTC](https://discuss.elastic.co/t/multi-match-query-issue/136988/4 "2018-07-04T12:19:38Z")

</div>

Looking at the query you posted above, it looks like there several fields for `proceedingslanguage`, and we are looking for `EN` term in all these fields.

If you have just a single field `proceedingslanguage`, you don't need `multi_match` query, you can just use `term` query:

```auto
"query": {
    "term" : { "proceedingslanguage" : "EN" } 
  }

```

---

<div class="post-metadata">

**Author:** ![mohammedEssabri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mohammedessabri/32/42177_2.png) [@mohammedEssabri](https://discuss.elastic.co/u/mohammedEssabri)\
**Post date:** [July 9, 2018, 4:02pm UTC](https://discuss.elastic.co/t/multi-match-query-issue/136988/5 "2018-07-09T16:02:38Z")

</div>

Dear @mayya,  
Thank you for your help!

I share the same idea with you, but the query is already working in another Environment.

Please note that the application is deployed in 5 environments, but this query is working only in 2 environments including prod environment.  
And the client don't accept a change on the code as it's already working in PROD environment.

Best regards,  
Mohammed ESSABRI

---

<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:** [August 6, 2018, 4:02pm UTC](https://discuss.elastic.co/t/multi-match-query-issue/136988/6 "2018-08-06T16:02:48Z")

</div>

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