简体   繁体   中英

Mapping two float fields containing geo langitude and latitude into geo_point in kibana using the AWS ElasticSearch Service Instance

I'm building a solution that processes the data from Lambda(Python 2.7) through kinesis stream and firehose to Elastic Search domain. Data is stored in Python dictionary and dumped as a JSON to Kinesis

                dataDictionary = {
                "precipitationType": precipitationType,
                "location": location,
                "humidity" : humidity,
                "groundTemp": groundTemp,
                "airTemp": airTemp,
                "windSpeed": windSpeed,
                "windDirection": windDirection,
                "measureDate": parsedMeasureDate,
                "systemDate": systemDate,
                "stationGeoLatitude": stationGeoLatitude,
                "stationGeoLongitude": stationGeoLongitude
            }
            #Push data to AWS Kinesis Stream
            res = kinesis.put_record(StreamName = LocalStreamName,Data=json.dumps(dataDictionary),PartitionKey='systemDate')

Process is succesful but in want to display the results on map in Kibana I only have two float fields and no geo_point/geohash fields

I cannot figure out how to map them in AWS ElasticSearch Service. I found some documentation about mapping but I have no idea how to use it inside AWS. Maybe I should pass this data in other way in Python code?

You have to use mappings and tell elasticsearch to map your 2 fields as a geo-point location:

https://www.elastic.co/guide/en/elasticsearch/reference/current/geo-point.html

You will have to reindex your data, but first specify your mappings.

You could do it using python client, or post the json mapping manualy:

PUT your_index

{
  "mappings": {
    "your_type": {
      "properties": {
        "location": {
          "type": "geo_point"
        }
      }
    }
  }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM