0
0
Elasticsearchquery~5 mins

Geo-point and geo-shape types in Elasticsearch - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a geo-point type in Elasticsearch?
A geo-point type stores a single geographical point defined by latitude and longitude coordinates. It is used for location-based queries like distance or bounding box searches.
Click to reveal answer
beginner
What kind of data does the geo-shape type store?
The geo-shape type stores complex shapes such as polygons, lines, and multi-points. It allows spatial queries like intersection, containment, and distance on these shapes.
Click to reveal answer
beginner
How do you define a geo-point field in an Elasticsearch mapping?
You define it by setting the field type to "geo_point" in the mapping. For example:
{ "properties": { "location": { "type": "geo_point" } } }
Click to reveal answer
beginner
Name one common query type used with geo-point fields.
The geo_distance query finds documents with geo-points within a certain distance from a given point.
Click to reveal answer
intermediate
What is the difference between geo-point and geo-shape types?
Geo-point stores a single point (latitude and longitude). Geo-shape stores complex shapes like polygons or lines. Geo-shape supports more advanced spatial queries.
Click to reveal answer
Which Elasticsearch type would you use to store a single location coordinate?
Ageo_point
Bgeo_shape
Ckeyword
Dtext
Which query is best to find documents within 10km of a location?
Ageo_distance
Bmatch
Cterm
Drange
What kind of shapes can geo-shape store?
AOnly points
BNumbers
CText strings
DPolygons, lines, and multi-points
How do you specify a geo-point field in Elasticsearch mapping?
A"type": "geo_shape"
B"type": "geo_point"
C"type": "text"
D"type": "integer"
Which type supports spatial queries like intersection and containment?
Akeyword
Bgeo_point
Cgeo_shape
Ddate
Explain the difference between geo-point and geo-shape types in Elasticsearch.
Think about simple points versus polygons or lines.
You got /4 concepts.
    Describe how you would define and query a location field using geo-point in Elasticsearch.
    Start with the mapping, then how to search nearby points.
    You got /4 concepts.