# Wildcard 查询(通配符查询)

匹配与通配符表达式具有匹配字段的文档（**not analyzed**）。支持的通配符是 “\*”，它匹配任何字符序列（包括空字符）；还有 “？”，它匹配任何单个字符。请注意，此查询可能很慢，因为它需要迭代多个项。为了防止极慢的通配符查询，通配符项不应以通配符 “\*” 或 “？” 开头。通配符查询对应**Lucene**的**WildcardQuery** 。

```
GET /_search
{
    "query": {
        "wildcard" : { "user" : "ki*y" }
    }
}
```

&#x20;*boost*也可以与查询相关联：

```
GET /_search
{
    "query": {
        "wildcard" : { "user" : { "value" : "ki*y", "boost" : 2.0 } }
    }
}
```

或者这样：

```
GET /_search
{
    "query": {
        "wildcard" : { "user" : { "wildcard" : "ki*y", "boost" : 2.0 } }
    }
}
```

此多项查询允许如何控制使用*rewrite*参数重写。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://xiaoxiami.gitbook.io/elasticsearch/ji-chu/35query-dsldslfang-shi-cha-8be229/354zhu-yu-ji-bie-cha-8be228-term-level-queries/wildcard-cha-8be228-tong-pei-fu-cha-8be229.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
