Combining the latitude and longitude fields under lookupResult as a location field

Remember when we defined the index template mapping for our index? We defined the location field to be of geo_point type. The geo_point type accepts a value that is formatted as a string with latitude and longitude appended together, separated by a comma.

This is achieved by using the add_field operation to construct the location field, as follows:

 add_field => {
"location" => "%{[lookupResult][0][latitude]},%{[lookupResult][0][longitude]}"
}

By now, we should have a new field called location added to our JSON payload, exactly as desired. Next, we will remove the undesirable fields.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.189.157.248