Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Elasticsearch Essentials

You're reading from  Elasticsearch Essentials

Product type Book
Published in Jan 2016
Publisher
ISBN-13 9781784391010
Pages 240 pages
Edition 1st Edition
Languages

Table of Contents (18) Chapters

Elasticsearch Essentials
Credits
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
Preface
Getting Started with Elasticsearch Understanding Document Analysis and Creating Mappings Putting Elasticsearch into Action Aggregations for Analytics Data Looks Better on Maps: Master Geo-Spatiality Document Relationships in NoSQL World Different Methods of Search and Bulk Operations Controlling Relevancy Cluster Scaling in Production Deployments Backups and Security Index

Working with geo-point data


Geo-points are single location points defined by a latitude-longitude pair on the surface of the earth. Using geo-points you can do the following things:

  • Calculate the distance between two points

  • Find the document that falls in a specified rectangular area

  • Sort documents based on distance and score results based on it

  • Create clusters of geo-points using aggregations

Mapping geo-point fields

Unlike all the data types in Elasticsearch, geo-point fields can't be determined dynamically. So, you have to define the mapping in advance before indexing data. The mapping for a geo-point field can be defined in the following format:

"location": {
    "type": "geo_point"
}

A geo_point mapping indexes a single field (the location in our example) in the lat-lon format. You can optionally index .lat and .lon separately by setting the lat-lon parameter to true.

Indexing geo-point data

Elasticsearch supports the following three formats to index geo_point data with the same mapping that...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}