Hello, I'm new here, I've been using elasticsearch for a month and I wanted to solve some doubts, despite reading the documentation and searching I do not get what I'm looking for.
I am trying to index information in JSON-LD format and what I want is to visualize the geographic data but these are multipolygons and polygons, I am seeing the form with geo_shape but it gives me an error in the mapping. Yesterday I made some examples with geo_point for the cases in which they are points and I visualize them correctly. If someone could help me out I would appreciate it very much.
These are the examples that i'm trying:
**************** 1 example correct ****************************
PUT /museums
{
"mappings": {
"_doc": {
"properties": {
"location": {
"type": "geo_point"
}
}
}
}
}
POST /museums/_doc/_bulk?refresh
{"index":{"_id":1}}
{"location": "52.374081,4.912350", "name": "NEMO Science Museum"}
{"index":{"_id":2}}
{"location": "52.369219,4.901618", "name": "Museum Het Rembrandthuis"}
{"index":{"_id":3}}
{"location": "52.371667,4.914722", "name": "Nederlands Scheepvaartmuseum"}
{"index":{"_id":4}}
{"location": "51.222900,4.405200", "name": "Letterenhuis"}
{"index":{"_id":5}}
{"location": "48.861111,2.336389", "name": "Musée du Louvre"}
{"index":{"_id":6}}
{"location": "48.860000,2.327000", "name": "Musée d'Orsay"}
POST /museums/_search?size=0
{
"aggregations" : {
"large-grid" : {
"geohash_grid" : {
"field" : "location",
"precision" : 3
}
}
}
}
******************* 2 example NO correct *****************
PUT /museums_2
{
"mappings": {
"_doc": {
"properties": {
"location": {
"type": "geo_shape"
}
}
}
}
}
DELETE /museums_2
GET museums_2/_mapping
POST /museums_2/_doc/_bulk?refresh
{"index":{"_id":1}}
{"location":{"type":"linestring","coordinates":[[-77.03653,38.897676],[-77.009051,38.889939]]}}
POST /museums_2/_search?size=0
{
"aggregations" : {
"large-grid" : {
"geohash_grid" : {
"field" : "location",
"precision" : 3
}
}
}
}
I would like to be able to visualize linestring as the first example and then move on to multipolygonos and know how.
Thank you!