# String query explain \*:\*

**URL:** <https://discuss.elastic.co/t/string-query-explain/147664>\
**Category:** Elasticsearch\
**Created:** [September 7, 2018, 6:57am UTC](https://discuss.elastic.co/t/string-query-explain/147664 "2018-09-07T06:57:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zajca](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zajca/32/26576_2.png) [@zajca](https://discuss.elastic.co/u/zajca)\
**Post date:** [September 7, 2018, 6:57am UTC](https://discuss.elastic.co/t/string-query-explain/147664/1 "2018-09-07T06:57:11Z")

</div>

Hi,  
I'm getting weird match with string query.  
This is what explain returns:

```auto
{
  "_index": "unit",
  "_type": "unit",
  "_id": "6wnIsmUBR6RhLqpGBfHA",
  "matched": true,
  "explanation": {
    "value": 1,
    "description": "sum of:",
    "details": [
      {
        "value": 1,
        "description": "*:*",
        "details": []
      }
    ]
  }
}

```

This is string which is matching:

```auto
Technik údržby těžní jámy koordinuje práce při zajišťování báňské údržby a provozu těžní jámy.
_analyze:
technik, technika, udrzba, tezni, jama, koordinovat, prace, zajistovani, bansky, udrzba, provoz, tezni, jama

```

with this query:

```auto
{
  "query": {
    "query_string": {
      "analyzer": "cz",
      "analyze_wildcard": true,
      "query": "*daty* OR *data* OR *výpoč* OR *dat * OR *datový* OR *datové* OR *datová*"
    }
  }
}
_analyze:
datum, datum, vypoc, datum, datovy, datovy, datovy,

```

I don't see anything that should match with this.

this is my settings and mappings:

```auto
{
  "properties": {
    "db_id": {
      "type": "integer"
    },
    "characteristics": {
      "type": "text",
      "analyzer": "cz",
      "index": true
    }
  },
  "settings": {
    "analysis": {
      "analyzer": {
        "cz": {
          "type": "custom",
          "tokenizer": "icu_tokenizer",
          "filter": [
            "icu_normalizer",
            "cz_stop",
            "cz_length",
            "standard",
            "lowercase",
            "cz_stop",
            "cs_CZ",
            "icu_folding",
            "cz_unique"
          ]
        }
      },
      "filter": {
        "cz_stop": {
          "type": "stop",
          "stopwords": [
            "právě",
            "že",
            "_czech_"
          ],
          "ignore_case": true
        },
        "cs_CZ": {
          "type": "hunspell",
          "locale": "cs_CZ",
          "dedup": true,
          "recursion_level": 0
        },
        "remove_duplicities": {
          "type": "unique",
          "only_on_same_position": true
        },
        "cz_length": {
          "type": "length",
          "min": 2
        },
        "cz_unique": {
          "type": "unique",
          "only_on_same_position": true
        },
        "cz_collation": {
          "type": "icu_collation",
          "language": "cs"
        }
      }
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![abdon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abdon/32/9195_2.png) [@abdon](https://discuss.elastic.co/u/abdon)\
**Post date:** [September 7, 2018, 2:12pm UTC](https://discuss.elastic.co/t/string-query-explain/147664/2 "2018-09-07T14:12:50Z")

</div>

There is a space between `dat` and `*` in your query. As a result, Elasticsearch will search for just `*` which will match any term in any field. As a result, any document is going to be a hit for your query.

---

<div class="post-metadata">

**Author:** ![zajca](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zajca/32/26576_2.png) [@zajca](https://discuss.elastic.co/u/zajca)\
**Post date:** [September 7, 2018, 10:10pm UTC](https://discuss.elastic.co/t/string-query-explain/147664/3 "2018-09-07T22:10:23Z")

</div>

Oh I'm stupid I missed that and spend whole day looking for error 😕 Thank you @abdon very much

---

<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:** [October 5, 2018, 10:18pm UTC](https://discuss.elastic.co/t/string-query-explain/147664/4 "2018-10-05T22:18:43Z")

</div>

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