# Wildcard query returns 0 result

**URL:** <https://discuss.elastic.co/t/wildcard-query-returns-0-result/290549>\
**Category:** Elasticsearch\
**Created:** [November 30, 2021, 10:39am UTC](https://discuss.elastic.co/t/wildcard-query-returns-0-result/290549 "2021-11-30T10:39:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wonder\_Garance](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wonder_garance/32/91180_2.png) [@Wonder\_Garance](https://discuss.elastic.co/u/Wonder_Garance)\
**Post date:** [November 30, 2021, 10:39am UTC](https://discuss.elastic.co/t/wildcard-query-returns-0-result/290549/1 "2021-11-30T10:39:42Z")

</div>

I have a problem with the char '?' in the wildcard query, the query below returns 0 result

```auto
{
  "query": {
    "span_near": {
      "clauses": [
        {
          "span_multi": {
            "match": {
              "wildcard": {"text": { "value": "mariag?"}}
            }
          }
        }
      ],
      "slop": 5,
      "in_order": true
    }
  }
}

```

The word mariage is in more than 1000 indexed docucments.

When I run the query in the Search Profiler, I get the error:  
SpanMatchNoDocsQuery("no expansion found for text:mariag?")

What does this mean? I can't find info on website, and how to correct it? Thanks a lot.

---

<div class="post-metadata">

**Author:** ![AquaX](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aquax/32/92006_2.png) [@AquaX](https://discuss.elastic.co/u/AquaX)\
**Post date:** [December 21, 2021, 3:31pm UTC](https://discuss.elastic.co/t/wildcard-query-returns-0-result/290549/2 "2021-12-21T15:31:25Z")

</div>

Out of curiosity are you using the French word "mariage" or should it be the English version "marriage"? Sometimes a simple spelling mistake can be the issue 😉

---

<div class="post-metadata">

**Author:** ![Wonder\_Garance](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wonder_garance/32/91180_2.png) [@Wonder\_Garance](https://discuss.elastic.co/u/Wonder_Garance)\
**Post date:** [December 21, 2021, 5:27pm UTC](https://discuss.elastic.co/t/wildcard-query-returns-0-result/290549/3 "2021-12-21T17:27:28Z")

</div>

Hello @AquaX, I indexed French documents with word "mariage".  
The field "text" has a French stemming filter and I met the error:  
SpanMatchNoDocsQuery("no expansion found for text:mariag?")

When I changed the wildcard search field "text" to a field without stemming, the wildcard search with ? worked well, so I got results.

---

<div class="post-metadata">

**Author:** ![AquaX](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aquax/32/92006_2.png) [@AquaX](https://discuss.elastic.co/u/AquaX)\
**Post date:** [December 21, 2021, 5:29pm UTC](https://discuss.elastic.co/t/wildcard-query-returns-0-result/290549/4 "2021-12-21T17:29:10Z")

</div>

Ok! Great! Just wanted to double check as sometimes I make silly spelling mistakes and rip my hair our for hours over something simple. Glad you got it figured out.

---

<div class="post-metadata">

**Author:** ![Wonder\_Garance](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wonder_garance/32/91180_2.png) [@Wonder\_Garance](https://discuss.elastic.co/u/Wonder_Garance)\
**Post date:** [December 21, 2021, 8:07pm UTC](https://discuss.elastic.co/t/wildcard-query-returns-0-result/290549/5 "2021-12-21T20:07:55Z")

</div>

@AquaX thank you for your response, sometimes I make mistakes too 😅

---

<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:** [January 18, 2022, 8:08pm UTC](https://discuss.elastic.co/t/wildcard-query-returns-0-result/290549/6 "2022-01-18T20:08:46Z")

</div>

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