Wildcard

Wildcard query

/ Wildcard, / Query

Wildcard query #

Returns documents that contain terms matching a wildcard pattern. The pattern supports * (any sequence of characters, including none) and ? (any single character).

Inside a nested query: not supported yet — the clause is rejected with an HTTP 400 naming the offending clause.

How it works #

The pattern is expanded against the inverted index’s term dictionary: the engine walks the field’s terms, keeps those matching the pattern, and unions their postings lists — the same result as a should of term queries over the surviving terms. Matching is anchored at both ends: web-1 is the whole term, so web-* matches web-10 and web-1 itself, but *web-1* is required for anything with text on both sides.

...