Multipolygon query

Hey guys,

i want to make a query on a multipolygon array and dont know if it is possible.

i have some tables where the coordinates stored as point and want to find all these document within a polygon or a multipolygon.

on a polygon it works like this example

[
                        "size" => 20,
                        "query" => [
                            "bool" => [
                                "must" => [
                                    "match_all" => (object)[]
                                ],
                                "filter" => [
                                    "geo_polygon" => [
                                        "location" => [
                                            "points" => $polygon
                                        ]
                                    ]
                                ]
                            ]

                        ]

but how to query if the $polygon array is an multipolygon?

I don't think geo_polygon query supports multipolygons. You would have to either switch from geo_point type to geo_shape type and use geo_shape query create several geo_polygon queries yourself and combine them using a boolean query.

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