Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
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
1. Getting Started with Elasticsearch 2. Understanding Document Analysis and Creating Mappings 3. Putting Elasticsearch into Action 4. Aggregations for Analytics 5. Data Looks Better on Maps: Master Geo-Spatiality 6. Document Relationships in NoSQL World 7. Different Methods of Search and Bulk Operations 8. Controlling Relevancy 9. Cluster Scaling in Production Deployments 10. Backups and Security Index

Geo-shapes


Geo-shapes are completely different from geo-points. Until now we have worked with simple geo-location and rectangle searches. However, with geo-shapes, the sky is the limit. On a map, you can simply draw a line, polygon, or circle and ask Elasticsearch to populate the data according to the co-ordinates of your queries, as seen in the following image:

Let's see some of the most important geo-shapes.

Point

A point is a single geographical coordinate, such as your current location shown by your smart-phone. A point in Elasticsearch is represented as follows:

{
    "location" : {
        "type" : "point",
        "coordinates" : [28.498564, 77.0812823]
    }
}

Linestring

A linestring can be defined in two ways. If it contains two coordinates, it will be a straight line, but if it contains more than two points, it will be an arbitrary path:

{
    "location" : {
        "type" : "linestring",
        "coordinates" : [[-77.03653, 38.897676], [-77.009051, 38.889939]]
    }
}

Circles

A circle...

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}