Point field type
The point data type facilitates the indexing of and searching arbitrary x, y pairs that fall in a 2-dimensional planar coordinate system.
You can query documents using this type using shape Query.
There are four ways that a point may be specified, as demonstrated below:
PUT my-index-000001
{
"mappings": {
"properties": {
"location": {
"type": "point"
}
}
}
}
PUT my-index-000001/_doc/1
{
"text": "Point as an object",
"location": {
"x": 41.12,
"y": -71.34
}
}
PUT my-index-000001/_doc/2
{
"text": "Point as a string",
"location": "41.12,-71.34"
}
PUT my-index-000001/_doc/4
{
"text": "Point as an array",
"location": [41.12, -71.34]
}
PUT my-index-000001/_doc/5
{
"text": "Point as a WKT POINT primitive",
"location" : "POINT (41.12 -71.34)"
} | Point expressed as an object, with | |
| Point expressed as a string with the format: | |
| Point expressed as an array with the format: [ | |
| Point expressed as a Well-Known Text POINT with the format: |
The coordinates provided to the indexer are single precision floating point values so the field guarantees the same accuracy provided by the java virtual machine (typically 1E-38).
Parameters for point fields
The following parameters are accepted by point fields:
| If | |
| | If |
| Accepts an point value which is substituted for any explicit |
Sorting and retrieving points
It is currently not possible to sort points or retrieve their fields directly. The point value is only retrievable through the _source field.
© 2023-2025 Elasticsearch
As of September 2024, Elasticsearch is available under a choice of three licenses: the Server Side Public License (SSPL), the Elastic License, or the AGPLv3 (OSI approved).
Elasticsearch and the Elasticsearch logo are trademarks of Elasticsearch B.V., registered in the U.S. and in other countries.
https://www.elastic.co/guide/en/elasticsearch/reference/7.17/point.html