Percolate nested document with geobounding box filter in percolator


(razafinr) #1

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 ?


(Martijn Van Groningen) #2

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 wrote:

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 ?

--
View this message in context:
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.

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/1400570685346-4056124.post%40n3.nabble.com
.
For more options, visit 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.
To view this discussion on the web visit 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.


(razafinr) #3

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"
}
}

}


(system) #4