# Ids Query(ID 查询)

仅仅过滤与所提供的**ID**相匹配的文档。

> 注意：该查询将使用 [**\_uid**](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-uid-field.html) 字段。

```
GET /_search
{
    "query": {
        "ids" : {
            "type" : "my_type",
            "values" : ["1", "4", "100"]
        }
    }
}
```

类型是可选的，也可以省略，也可以接受值数组。如果未指定任何类型，则尝试使用在索引映射中定义的所有类型。


---

# 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/ids-queryid-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.
