# Elasticsearch Index Polygons?

**URL:** https://discuss.elastic.co/t/elasticsearch-index-polygons/22346
**Category:** Elasticsearch
**Created:** [February 24, 2015, 5:38am UTC](https://discuss.elastic.co/t/elasticsearch-index-polygons/22346 "2015-02-24T05:38:37Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![saipa](https://avatars.discourse-cdn.com/v4/letter/s/c5a1d2/32.png) [@saipa](https://discuss.elastic.co/u/saipa)
#### Post date: [February 24, 2015, 5:38am UTC](https://discuss.elastic.co/t/elasticsearch-index-polygons/22346/1 "2015-02-24T05:38:37Z")

</div>

So I see the elasticsearch claims to use "GeoJSON" as the format for  
indexing... but when I look at the docs.. the same it gives is:

{  
"location" : {  
"type" : "polygon",  
"coordinates" : [  
[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ]  
]  
}  
}

Doesn't GeoJSON look like this?

{  
"type": "Feature",  
"properties": {  
"name": "Sparkle",  
"age": 11  
},  
geometry: {  
"type" : "polygon",  
"coordinates" : [[[100.0, 0.0], [101.0,0.0], [101.0, 1.0], [100.0],  
[100.0, 0.0]]]  
}  
}

My question is how do I index polygons in elasticsearch if I want to attach  
properties to it? If I wanted to perform a bulk load for example, what does  
one document look like that has polygon information that I can perform  
geospatial queries on?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/41cd2d8a-e5e1-450b-bb2f-d9ddac69633b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/41cd2d8a-e5e1-450b-bb2f-d9ddac69633b%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![johtani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johtani/32/44956_2.png) [@johtani](https://discuss.elastic.co/u/johtani)
#### Post date: [February 24, 2015, 6:20am UTC](https://discuss.elastic.co/t/elasticsearch-index-polygons/22346/2 "2015-02-24T06:20:58Z")

</div>

Hi,

Will this help you?

> **[Elastic — The Search AI Company](https://www.elastic.co)**
>
> Power insights and outcomes with The Elastic Search AI Platform. See into your data and find answers that matter with enterprise solutions designed to help you accelerate time to insight. Try Elastic ...

2015-02-24 14:38 GMT+09:00 Sai Asuka [asuka.shin@gmail.com](mailto:asuka.shin@gmail.com):

> So I see the elasticsearch claims to use "GeoJSON" as the format for  
> indexing... but when I look at the docs.. the same it gives is:
> 
> {  
> "location" : {  
> "type" : "polygon",  
> "coordinates" : [  
> [[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ]  
> ]  
> }  
> }
> 
> Doesn't GeoJSON look like this?
> 
> {  
> "type": "Feature",  
> "properties": {  
> "name": "Sparkle",  
> "age": 11  
> },  
> geometry: {  
> "type" : "polygon",  
> "coordinates" : [[[100.0, 0.0], [101.0,0.0], [101.0, 1.0], [100.0],  
> [100.0, 0.0]]]  
> }  
> }
> 
> My question is how do I index polygons in elasticsearch if I want to  
> attach properties to it? If I wanted to perform a bulk load for example,  
> what does one document look like that has polygon information that I can  
> perform geospatial queries on?
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/41cd2d8a-e5e1-450b-bb2f-d9ddac69633b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/41cd2d8a-e5e1-450b-bb2f-d9ddac69633b%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/41cd2d8a-e5e1-450b-bb2f-d9ddac69633b%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/41cd2d8a-e5e1-450b-bb2f-d9ddac69633b%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

## --

Jun Ohtani  
blog : [http://blog.johtani.info](http://blog.johtani.info)

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAPW8A5yKUahAPmHRVMTY5o-rK45YQ9TijXtuBSYP9UBeapEREA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPW8A5yKUahAPmHRVMTY5o-rK45YQ9TijXtuBSYP9UBeapEREA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![saipa](https://avatars.discourse-cdn.com/v4/letter/s/c5a1d2/32.png) [@saipa](https://discuss.elastic.co/u/saipa)
#### Post date: [February 24, 2015, 2:09pm UTC](https://discuss.elastic.co/t/elasticsearch-index-polygons/22346/4 "2015-02-24T14:09:15Z")

</div>

Can additional, searchable properties fields be added to this? Say I wanted  
to do a geosearch by location and by time property?

Is it recommended to shove it into a properties: {} field like geojson? Or  
is it supposed to be peer to location or does it not really matter?

On Tuesday, February 24, 2015 at 3:52:50 AM UTC-5, Georgi Ivanov wrote:

> Like Jun said,  
> You need geo shape type.
> 
> The problem is, it is very slow to index shapes (except POINT).
> 
> I tried with line-strings and it is extremely slow with linestring 10  
> points long or longer.
> 
> It is just killing the CPU.
> 
> On Tuesday, February 24, 2015 at 6:38:37 AM UTC+1, Sai Asuka wrote:
> 
> > So I see the elasticsearch claims to use "GeoJSON" as the format for  
> > indexing... but when I look at the docs.. the same it gives is:
> > 
> > {  
> > "location" : {  
> > "type" : "polygon",  
> > "coordinates" : [  
> > [[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ]  
> > ]  
> > }  
> > }
> > 
> > Doesn't GeoJSON look like this?
> > 
> > {  
> > "type": "Feature",  
> > "properties": {  
> > "name": "Sparkle",  
> > "age": 11  
> > },  
> > geometry: {  
> > "type" : "polygon",  
> > "coordinates" : [[[100.0, 0.0], [101.0,0.0], [101.0, 1.0], [100.0],  
> > [100.0, 0.0]]]  
> > }  
> > }
> > 
> > My question is how do I index polygons in elasticsearch if I want to  
> > attach properties to it? If I wanted to perform a bulk load for example,  
> > what does one document look like that has polygon information that I can  
> > perform geospatial queries on?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/cdb3c63b-a58f-4c0a-bc76-6bc10b163513%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/cdb3c63b-a58f-4c0a-bc76-6bc10b163513%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 6, 2017, 12:30am UTC](https://discuss.elastic.co/t/elasticsearch-index-polygons/22346/6 "2017-07-06T00:30:29Z")

</div>


