# Using query\_string on 2 fields with different analyzers does not give any result

**URL:** <https://discuss.elastic.co/t/using-query-string-on-2-fields-with-different-analyzers-does-not-give-any-result/79418>\
**Category:** Elasticsearch\
**Created:** [March 21, 2017, 1:04pm UTC](https://discuss.elastic.co/t/using-query-string-on-2-fields-with-different-analyzers-does-not-give-any-result/79418 "2017-03-21T13:04:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbs](https://avatars.discourse-cdn.com/v4/letter/j/5fc32e/32.png) [@jbs](https://discuss.elastic.co/u/jbs)\
**Post date:** [March 21, 2017, 1:04pm UTC](https://discuss.elastic.co/t/using-query-string-on-2-fields-with-different-analyzers-does-not-give-any-result/79418/1 "2017-03-21T13:04:46Z")

</div>

Hi

I've read a few posts on this forum saying that when writing a query\_string without specifying analyzer ElasticSearch will automatically use search\_analyzer for all fields, not sure if I understood correctly, but this code does not work for example (for ES 2.4, but I've seen the same result on ES 5.2) :

```auto
PUT test_analyzer
{
  "settings": {},
  "mappings": {
    "test": {
      "properties": {
        "FR": {
          "type": "string",
          "analyzer": "french",
          "search_analyzer":"french"
        },
        "EN": {
          "type": "string",
          "analyzer": "english",
          "search_analyzer":"english"
        }
      }
    }
  }
}

POST test_analyzer/test
{
  "FR": "Terme pour"
}

GET test_analyzer/test/_search
{
  "from": 0,
  "size": 10,
  "query": {
    "bool": {
      "must": [
        {
          "query_string": {
            "query": "Terme pour",
            "fields": [
              "FR",
              "EN"
            ],
            "default_operator": "and"
          }
        }
      ]
    }
  }
}

```

This query does not return anything.  
If I remove the field "EN" then it works correctly, or if I force the "french" analyzer in the query\_string.  
It seems to happen if the string contains a stop word ("pour" is a french stop word).

Is this the expected behaviour or am I doing something wrong ?  
I might have a work around by using multiple query\_string, one for each analyzer (I have around 5 analyzers so I could do that), but still I find this behaviour quite strange.

---

<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:** [April 18, 2017, 1:04pm UTC](https://discuss.elastic.co/t/using-query-string-on-2-fields-with-different-analyzers-does-not-give-any-result/79418/2 "2017-04-18T13:04:51Z")

</div>

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