# Why query\_string not worked when used in highlight\_query？

**URL:** <https://discuss.elastic.co/t/why-query-string-not-worked-when-used-in-highlight-query/304897>\
**Category:** Elasticsearch\
**Created:** [May 17, 2022, 7:39am UTC](https://discuss.elastic.co/t/why-query-string-not-worked-when-used-in-highlight-query/304897 "2022-05-17T07:39:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![slightKB](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/slightkb/32/105760_2.png) [@slightKB](https://discuss.elastic.co/u/slightKB)\
**Post date:** [May 17, 2022, 7:39am UTC](https://discuss.elastic.co/t/why-query-string-not-worked-when-used-in-highlight-query/304897/1 "2022-05-17T07:39:11Z")

</div>

```auto
field "regAggress" is Text type

"regContactAddress" : {
          "type" : "text",
          "analyzer" : "aliws"
}

query example:
{
  "_source": ["regContactAddress","_id","entName"], 
  "highlight": {
    "fields": {
      "regContactAddress": {
        "fragment_size": 10,
        "number_of_fragments": 1,
        "highlight_query": {
          "query_string": {
            "default_field": "regContactAddress",
            "query": "天津滨海新区",
            "default_operator": "AND"
          }
        },
        "force_source": "false"
      }
    }
  },
  "query": {
    "query_string": {
      "default_field": "regContactAddress",
      "query": "上海市浦东新区"
    }
  }
}
when I execute that query，result is :
{
        "_source" : {
          "regContactAddress" : "上海市浦东新区浦东大道"
        },
        "highlight" : {
          "regContactAddress" : [
            "上海市浦东<em>新区</em>浦东大道"
          ]
        }
 }
why final result highlight_query <em>新区</em>? I think should match no <em> .

```

---

<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:** [June 14, 2022, 7:39am UTC](https://discuss.elastic.co/t/why-query-string-not-worked-when-used-in-highlight-query/304897/2 "2022-06-14T07:39:48Z")

</div>

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