> For the complete documentation index, see [llms.txt](https://xiaoxiami.gitbook.io/elasticsearch/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](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).

# 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"]
        }
    }
}
```

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