> 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/357di-li-wei-zhi-cha-xun-geo-queries/geo-distance-range-queryff08-di-li-ju-li-fan-wei-cha-xun-ff09.md).

# Geo Distance Range Query（地理距离范围查询）

> 5.0 的版本已经废弃

```
GET /_search
{
    "query": {
        "bool" : {
            "must" : {
                "match_all" : {}
            },
            "filter" : {
                "geo_distance_range" : {
                    "from" : "200km",
                    "to" : "400km",
                    "pin.location" : {
                        "lat" : 40,
                        "lon" : -70
                    }
                }
            }
        }
    }
}
```

支持与 [**geo\_distance**](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/query-dsl-geo-distance-query.html)过滤器相同的点位置参数和查询选项。 并且还支持范围（**lt，lte，gt，gte，from，to，include\_upper** 和**include\_lower**）的常用参数。

## Ignore Unmapped（忽略未映射） <a href="#geodistancerangequery-di-li-ju-li-fan-wei-cha-xun-ignoreunmapped-hu-lve-wei-ying-she" id="geodistancerangequery-di-li-ju-li-fan-wei-cha-xun-ignoreunmapped-hu-lve-wei-ying-she"></a>

当设置为**true**时，**ignore\_unmapped**选项将忽略未映射字段，并且将不匹配此查询的任何文档。 当查询可能具有不同映射的多个索引时，这可能很有用。 当设置为**false**（默认值）时，如果字段未映射，则查询将抛出异常。
