# DSL query match doesnt work

**URL:** <https://discuss.elastic.co/t/dsl-query-match-doesnt-work/183207>\
**Category:** Elasticsearch\
**Created:** [May 29, 2019, 3:16am UTC](https://discuss.elastic.co/t/dsl-query-match-doesnt-work/183207 "2019-05-29T03:16:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![madhan\_dc](https://avatars.discourse-cdn.com/v4/letter/m/6a8cbe/32.png) [@madhan\_dc](https://discuss.elastic.co/u/madhan_dc)\
**Post date:** [May 29, 2019, 3:16am UTC](https://discuss.elastic.co/t/dsl-query-match-doesnt-work/183207/1 "2019-05-29T03:16:56Z")

</div>

```
GET /qstats_index/_search
 {
 "query": {
   
 "match": { "queue_name": "SYSTEM" }

```

doesnt match even though there are documents out there

```
 "hits" : [
  {
    "_index" : "qstats_index",
    "_type" : "qstats",
    "_id" : "oq0g_GoBKkUShOkmq4ml",
    "_score" : 1.0,
    "_source" : {
      "pers_put_bytes" : 0,
      "interval_end_date_time" : "2019-05-26T12:31:28.000Z",
      "pers_get_bytes" : 0,
      "creation_time" : "05.01.17",
      "pers_get_count" : 0,
      "nonpers_time_on_q_avg" : 0,
      "interval_start_date_time" : "2019-05-26T12:21:28.000Z",
      "nonpers_browse_count" : 0,
      "queue_name" : "SYSTEM.BROKER.ADMIN.STREAM",
      "put1_fail_count" : 0,

```

if i search for full exact queue name, it is working. am i missing any setting?

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [May 29, 2019, 7:08am UTC](https://discuss.elastic.co/t/dsl-query-match-doesnt-work/183207/2 "2019-05-29T07:08:01Z")

</div>

Hey,

it depends on your mapping if this works. If you have mapped that field as a keyword, than you would need to type the full name in your query. Can you share your mapping for that field as well?

Also, in order to get more information why a document has not matched there is the [explain API](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-explain.html).

hope this helps!

--Ale

---

<div class="post-metadata">

**Author:** ![madhan\_dc](https://avatars.discourse-cdn.com/v4/letter/m/6a8cbe/32.png) [@madhan\_dc](https://discuss.elastic.co/u/madhan_dc)\
**Post date:** [May 29, 2019, 12:05pm UTC](https://discuss.elastic.co/t/dsl-query-match-doesnt-work/183207/3 "2019-05-29T12:05:07Z")

</div>

```
 "queue_name": {
 "type": "text",
 "fields": {
 "keyword": {
 "type": "keyword",
 "ignore_above": 256
  }
  }
  },

```

it is set up keyword, how can i change it? I used logstash to create this index from reading a database using the jdbc plugin.

i was just reading this

[https://www.elastic.co/blog/strings-are-dead-long-live-strings](https://www.elastic.co/blog/strings-are-dead-long-live-strings)

it says with the above mapping i should be able to search using both keyword and text, is that not correct? Anycase, please let me know how i can change this so i can do partial searches instead of having to specify the entire queue name.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [June 3, 2019, 12:06pm UTC](https://discuss.elastic.co/t/dsl-query-match-doesnt-work/183207/4 "2019-06-03T12:06:03Z")

</div>

you just suffix the field name with `.keyword` and use that field for exact matches.

---

<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 1, 2019, 12:06pm UTC](https://discuss.elastic.co/t/dsl-query-match-doesnt-work/183207/5 "2019-07-01T12:06:22Z")

</div>

Closed on July 1, 2019, 12:06pm UTC

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