# “\[geo\_distance\] malformed query, expected \[END\_OBJECT\] but found \[FIELD\_NAME\]”

**URL:** <https://discuss.elastic.co/t/geo-distance-malformed-query-expected-end-object-but-found-field-name/260341>\
**Category:** Elasticsearch\
**Created:** [January 6, 2021, 12:48pm UTC](https://discuss.elastic.co/t/geo-distance-malformed-query-expected-end-object-but-found-field-name/260341 "2021-01-06T12:48:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![learn\_and\_try](https://avatars.discourse-cdn.com/v4/letter/l/eada6e/32.png) [@learn\_and\_try](https://discuss.elastic.co/u/learn_and_try)\
**Post date:** [January 6, 2021, 12:48pm UTC](https://discuss.elastic.co/t/geo-distance-malformed-query-expected-end-object-but-found-field-name/260341/1 "2021-01-06T12:48:30Z")

</div>

I am tried to create search queary with a values in 15m radios and between 3 weeks. I tried to execute this query:

> ```
> > "query": {
> > "bool": {
> > "must": {
> > "match_all": {}
> > }
> > , "filter": [
> > {
> > "geo_distance": {
> >      
> > "distance": "1000km",
> > "geoLocation": {
> > "lat": 31.966467334184614,
> > "lon": 35.83242623178664
> > }
> > }
> > ,
> > "range": {
> > "map_date": {
> > "gte": "now-3w/w",
> > "lte": "now/w"
> > }
> > }
> >     
> > }
> > ]
> > }}
> 
> ```

my date filed is : **map\_date** and my geo point filed is **geoLocation** I get this response :

```auto
{
  "error" : {
    "root_cause" : [
      {
        "type" : "parsing_exception",
        "reason" : "[geo_distance] malformed query, expected [END_OBJECT] but found [FIELD_NAME]",
        "line" : 18,
        "col" : 8
      }
    ],
    "type" : "x_content_parse_exception",
    "reason" : "[18:8] [bool] failed to parse field [filter]",
    "caused_by" : {
      "type" : "parsing_exception",
      "reason" : "[geo_distance] malformed query, expected [END_OBJECT] but found [FIELD_NAME]",
      "line" : 18,
      "col" : 8
    }
  },
  "status" : 400
}

```

help me plz to figure out what I am doing wrong 🙄

---

<div class="post-metadata">

**Author:** ![learn\_and\_try](https://avatars.discourse-cdn.com/v4/letter/l/eada6e/32.png) [@learn\_and\_try](https://discuss.elastic.co/u/learn_and_try)\
**Post date:** [January 6, 2021, 1:28pm UTC](https://discuss.elastic.co/t/geo-distance-malformed-query-expected-end-object-but-found-field-name/260341/2 "2021-01-06T13:28:05Z")

</div>

I get answer in stack: [https://stackoverflow.com/questions/65595936/geo-distance-malformed-query-expected-end-object-but-found-field-name](https://stackoverflow.com/questions/65595936/geo-distance-malformed-query-expected-end-object-but-found-field-name)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 3, 2021, 1:28pm UTC](https://discuss.elastic.co/t/geo-distance-malformed-query-expected-end-object-but-found-field-name/260341/3 "2021-02-03T13:28:37Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
