Query for specific geo_shape types

(Brian Hudson) #1

Is it possible to query a geo_shape field for shapes of a particular type?

(Glen Smith) #2

Can you clarify what you mean by type? geo_shape is the type.

(Brian Hudson) #3

Sorry, I meant by the GeoJSON type. I have a geo_shape field, where some documents contain a LineString and others a Polygon. I'd like to be able to query for all documents which have a Polygon geo_shape indexed in that field.

I don't think there is a way to do so, and I'll have to change my mapping around and reindex to support this.

(Russ Cam) #4

You'll need to index the type of geo_shape into a separate keyword field; it's not queryable on the geo_shape field itself as far as I am aware.

(Brian Hudson) #5

Yeah that's what I was thinking too.

Maybe I'll write up a feature request for making the GeoJSON type queryable, I think it could be useful.

(system) #6

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