# Percolate nested document with geobounding box filter in percolator

**URL:** https://discuss.elastic.co/t/percolate-nested-document-with-geobounding-box-filter-in-percolator/17613
**Category:** Elasticsearch
**Created:** [May 20, 2014, 7:24am UTC](https://discuss.elastic.co/t/percolate-nested-document-with-geobounding-box-filter-in-percolator/17613 "2014-05-20T07:24:45Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![razafinr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/razafinr/32/45334_2.png) [@razafinr](https://discuss.elastic.co/u/razafinr)
#### Post date: [May 20, 2014, 7:24am UTC](https://discuss.elastic.co/t/percolate-nested-document-with-geobounding-box-filter-in-percolator/17613/1 "2014-05-20T07:24:45Z")

</div>

Hi!

I am using elastic search 1.1.0;

I am trying to percolate a document with a nested object containing a geopoint. This is my percolator:

"\_source": {

```
"query": {
    "filtered": {
        "query": {
            "match_all": { }
        }
        "filter": {
            "and": {
                "filters": [
                    {
                        "nested": {
                            "filter": {
                                "geo_bbox": {
                                    "point": {
                                        "top_left": [
                                            4.559326171875
                                            45.08127861241874
                                        ]
                                        "bottom_right": [
                                            5.2130126953125
                                            44.692088041727814
                                        ]
                                    }
                                }
                            }
                            "path": "location"
                        }
                    }
                    {
                        "term": {
                            "os": "android"
                        }
                    }
                ]
            }
        }
    }
}

```

}

When I am trying to percolate this document I have no result:

{  
"doc": {  
"os": "android",  
"location": {  
"point": "44.933, 4.9"  
}  
}  
}

This document should match the percolator.

Do you have any idea why it doesn't work ?

---

<div class="post-metadata">

### Author: ![mvg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvg/32/98890_2.png) [@mvg](https://discuss.elastic.co/u/mvg)
#### Post date: [May 20, 2014, 9:22am UTC](https://discuss.elastic.co/t/percolate-nested-document-with-geobounding-box-filter-in-percolator/17613/2 "2014-05-20T09:22:11Z")

</div>

Is the `location` field an object field or a nested field? The nested  
filter should only be used if in the mapping you have specified the  
`location` field to be nested. If that isn't the case you can just remove  
the nested filter from you query.

On 20 May 2014 09:24, razafinr [raz.rado@gmail.com](mailto:raz.rado@gmail.com) wrote:

> Hi!
> 
> I am using Elasticsearch 1.1.0;
> 
> I am trying to percolate a document with a nested object containing a  
> geopoint. This is my percolator:
> 
> "\_source": {
> 
> ```
> "query": {
> "filtered": {
> "query": {
> "match_all": { }
> }
> "filter": {
> "and": {
> "filters": [
> {
> "nested": {
> "filter": {
> "geo_bbox": {
> "point": {
> "top_left": [
> 4.559326171875
> 45.08127861241874
> ]
> "bottom_right": [
> 5.2130126953125
> 44.692088041727814
> ]
> }
> }
> }
> "path": "location"
> }
> }
> {
> "term": {
> "os": "android"
> }
> }
> ]
> }
> }
> }
> }
> 
> ```
> 
> }
> 
> When I am trying to percolate this document I have no result:
> 
> {  
> "doc": {  
> "os": "android",  
> "location": {  
> "point": "44.933, 4.9"  
> }  
> }  
> }
> 
> This document should match the percolator.
> 
> Do you have any idea why it doesn't work ?
> 
> --  
> View this message in context:  
> [http://elasticsearch-users.115913.n3.nabble.com/Percolate-nested-document-with-geobounding-box-filter-in-percolator-tp4056124.html](http://elasticsearch-users.115913.n3.nabble.com/Percolate-nested-document-with-geobounding-box-filter-in-percolator-tp4056124.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/1400570685346-4056124.post%40n3.nabble.com](https://groups.google.com/d/msgid/elasticsearch/1400570685346-4056124.post%40n3.nabble.com)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
Met vriendelijke groet,

Martijn van Groningen

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CA%2BA76Ty7ZEK0\_1E4z2p7%3DKnnTx5XgDyC-0Ju%2BwbPHJo0hpwuVQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CA%2BA76Ty7ZEK0_1E4z2p7%3DKnnTx5XgDyC-0Ju%2BwbPHJo0hpwuVQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![razafinr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/razafinr/32/45334_2.png) [@razafinr](https://discuss.elastic.co/u/razafinr)
#### Post date: [May 20, 2014, 11:26am UTC](https://discuss.elastic.co/t/percolate-nested-document-with-geobounding-box-filter-in-percolator/17613/3 "2014-05-20T11:26:45Z")

</div>

Actually in my mapping, the location field is a nested field (here is my mapping for location):

"location": {

" type": "nested",  
" properties": {  
"accuracy": {  
"type": "long"  
},  
"date": {  
" type": "date"  
"format": "dateOptionalTime"  
},  
...  
"point": {  
"type": "geo\_point"  
}  
}

}

---

<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: [July 6, 2017, 1:28am UTC](https://discuss.elastic.co/t/percolate-nested-document-with-geobounding-box-filter-in-percolator/17613/4 "2017-07-06T01:28:11Z")

</div>


