Wildcard query returns 0 result

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

{
  "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.

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 :wink:

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.

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.

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

1 Like

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