# Geo\_point Unindexed

**URL:** https://discuss.elastic.co/t/geo-point-unindexed/102700
**Category:** Elasticsearch
**Created:** [October 4, 2017, 12:38pm UTC](https://discuss.elastic.co/t/geo-point-unindexed/102700 "2017-10-04T12:38:19Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![karnamonkster](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karnamonkster/32/67266_2.png) [@karnamonkster](https://discuss.elastic.co/u/karnamonkster)
#### Post date: [October 4, 2017, 12:38pm UTC](https://discuss.elastic.co/t/geo-point-unindexed/102700/1 "2017-10-04T12:38:20Z")

</div>

Hi,

I am not able to get the geo\_point indexed in the records  
The field gets converted with correct latitude and longitude fields  
storing it to location field also gets added successfully  
Also create a mapping template as below:

```
PUT _template/map
{
  "template": "scada-*",
  "settings": {},
  "mappings": {
    "_default_": {
      "properties": {
        "location": {
          "type": "geo_point",
            "ignore_malformed":true
          }
        }
      }
  }
}

```

Logstash Configuration

```
filter
{
mutate {
convert => {"latitude" => "float"}
convert => {"longitude" => "float"}
add_field => ["location","%{latitude},%{longitude}"]
convert => {"location" => "float"}
         }
}

```

Should i be using the default logstash template or make changes to the same?

---

<div class="post-metadata">

### Author: ![karnamonkster](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karnamonkster/32/67266_2.png) [@karnamonkster](https://discuss.elastic.co/u/karnamonkster)
#### Post date: [October 5, 2017, 5:37am UTC](https://discuss.elastic.co/t/geo-point-unindexed/102700/2 "2017-10-05T05:37:48Z")

</div>

Still facing the issue.  
Now i am getting the location field as "string".  
The problem is there are documents which are not parsed if the field do not have the latitude or longitude  
Event though mentioning the "location" field as float in the filter config applied.  
Also tried placing the ignore\_malformed in places in the mapping.  
Still no luck.

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [October 6, 2017, 4:40am UTC](https://discuss.elastic.co/t/geo-point-unindexed/102700/3 "2017-10-06T04:40:39Z")

</div>

Whats the output section look like?

---

<div class="post-metadata">

### Author: ![karnamonkster](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karnamonkster/32/67266_2.png) [@karnamonkster](https://discuss.elastic.co/u/karnamonkster)
#### Post date: [October 6, 2017, 6:59am UTC](https://discuss.elastic.co/t/geo-point-unindexed/102700/4 "2017-10-06T06:59:44Z")

</div>

Here is the output

```
output { 
elasticsearch
{ 
hosts => ["array of hosts"]
document_id => "%{field1}%{field2}"
index => "events-%{+YYYY.MM.dd}"
}
}
```

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [October 6, 2017, 7:15am UTC](https://discuss.elastic.co/t/geo-point-unindexed/102700/5 "2017-10-06T07:15:16Z")

</div>

> [@karnamonkster](#):
>
> "template": "scada-\*",

Does not match;

> [@karnamonkster](#):
>
> index =\> "events-%{+YYYY.MM.dd}"

The template directive above refers to the index pattern it should be matching.

---

<div class="post-metadata">

### Author: ![karnamonkster](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karnamonkster/32/67266_2.png) [@karnamonkster](https://discuss.elastic.co/u/karnamonkster)
#### Post date: [October 6, 2017, 7:20am UTC](https://discuss.elastic.co/t/geo-point-unindexed/102700/6 "2017-10-06T07:20:51Z")

</div>

I believe i tried that already , well that might be the issue, i have to check when i am back to work.  
Also will that index the geo\_point **location** field? Since i did get the geo\_point field but couldn't get that indexed.

During this struggle i removed the template above and tried to use the default logstash template named " **elasticsearch-template\_es5x.json**"

Will that also not bring the correct mapping because of the reason you mentioned about **"directive not matching"** have an effect on the data we index?

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [October 6, 2017, 7:21am UTC](https://discuss.elastic.co/t/geo-point-unindexed/102700/7 "2017-10-06T07:21:36Z")

</div>

Most likely, the default template matches `logstash-*`.

---

<div class="post-metadata">

### Author: ![karnamonkster](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karnamonkster/32/67266_2.png) [@karnamonkster](https://discuss.elastic.co/u/karnamonkster)
#### Post date: [October 6, 2017, 7:23am UTC](https://discuss.elastic.co/t/geo-point-unindexed/102700/8 "2017-10-06T07:23:44Z")

</div>

I believe i tried that already , well that might be the issue, i have to check that again  
Also will that index the geo\_point location field? Since i did get the geo\_point field but couldn't get that indexed.

And what needs to be added in the configuration to make sure the records with no Lat/lon details are not dropped from the index?

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [October 6, 2017, 7:26am UTC](https://discuss.elastic.co/t/geo-point-unindexed/102700/9 "2017-10-06T07:26:49Z")

</div>

> [@karnamonkster](#):
>
> And what needs to be added in the configuration to make sure the records with no Lat/lon details are not dropped from the index?

You'll need to zero them out so it holds a value, because a null value geopoint is invalid.

---

<div class="post-metadata">

### Author: ![karnamonkster](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karnamonkster/32/67266_2.png) [@karnamonkster](https://discuss.elastic.co/u/karnamonkster)
#### Post date: [October 6, 2017, 7:30am UTC](https://discuss.elastic.co/t/geo-point-unindexed/102700/10 "2017-10-06T07:30:18Z")

</div>

> [@warkolm](#):
>
> value

The value for such records is

```
latitude: -
longitude: -

```

currently the fields bring the empty data in the index like the way it is added  
`location : %{latitude},%{longitude}`

How to zero them out? in Logstash config or through ES mapping?

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [October 6, 2017, 8:13pm UTC](https://discuss.elastic.co/t/geo-point-unindexed/102700/11 "2017-10-06T20:13:01Z")

</div>

You can do it in Logstash, with a conditional, or you can use something like [https://www.elastic.co/guide/en/elasticsearch/reference/5.6/null-value.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/null-value.html) in Elasticsearch.

---

<div class="post-metadata">

### Author: ![karnamonkster](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karnamonkster/32/67266_2.png) [@karnamonkster](https://discuss.elastic.co/u/karnamonkster)
#### Post date: [October 8, 2017, 5:01am UTC](https://discuss.elastic.co/t/geo-point-unindexed/102700/12 "2017-10-08T05:01:56Z")

</div>

This also tried but no luck , I am getting all records but the location field still parsed as **string**

---

<div class="post-metadata">

### Author: ![karnamonkster](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karnamonkster/32/67266_2.png) [@karnamonkster](https://discuss.elastic.co/u/karnamonkster)
#### Post date: [October 8, 2017, 6:39am UTC](https://discuss.elastic.co/t/geo-point-unindexed/102700/13 "2017-10-08T06:39:04Z")

</div>

After trying multiple mappings and configuration changes The location field gets to geo\_point but remains unindexed.(missing events which do not have latitude or longitude)  
Please help, I believe this is the last hurdle

---

<div class="post-metadata">

### Author: ![karnamonkster](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karnamonkster/32/67266_2.png) [@karnamonkster](https://discuss.elastic.co/u/karnamonkster)
#### Post date: [October 8, 2017, 2:47pm UTC](https://discuss.elastic.co/t/geo-point-unindexed/102700/14 "2017-10-08T14:47:50Z")

</div>

![latlon](https://us1.discourse-cdn.com/elastic/original/3X/9/9/993eac346cec5032440d9650e7fb3392bfe19239.PNG)

Different results , yet not getting indexed  
Have been after it since a long time. No luck

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [October 9, 2017, 12:24am UTC](https://discuss.elastic.co/t/geo-point-unindexed/102700/15 "2017-10-09T00:24:37Z")

</div>

> [@karnamonkster](#):
>
> Different results , yet not getting indexed

What do you mean? It looks like it's a valid geopoint.

---

<div class="post-metadata">

### Author: ![karnamonkster](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karnamonkster/32/67266_2.png) [@karnamonkster](https://discuss.elastic.co/u/karnamonkster)
#### Post date: [October 9, 2017, 3:33am UTC](https://discuss.elastic.co/t/geo-point-unindexed/102700/16 "2017-10-09T03:33:04Z")

</div>

But i am not able to use it in my visualizations as this is unindexed

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [October 9, 2017, 3:34am UTC](https://discuss.elastic.co/t/geo-point-unindexed/102700/17 "2017-10-09T03:34:10Z")

</div>

The geopoint? What sort of visualisations are you looking at doing, because the main point of that is for maps.

---

<div class="post-metadata">

### Author: ![karnamonkster](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karnamonkster/32/67266_2.png) [@karnamonkster](https://discuss.elastic.co/u/karnamonkster)
#### Post date: [October 9, 2017, 3:46am UTC](https://discuss.elastic.co/t/geo-point-unindexed/102700/18 "2017-10-09T03:46:48Z")

</div>

That is correct, i need this for the Maps only,

---

<div class="post-metadata">

### Author: ![karnamonkster](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karnamonkster/32/67266_2.png) [@karnamonkster](https://discuss.elastic.co/u/karnamonkster)
#### Post date: [October 9, 2017, 3:55am UTC](https://discuss.elastic.co/t/geo-point-unindexed/102700/19 "2017-10-09T03:55:16Z")

</div>

Ok Now i am able to see the location field working!!!  
WOW!!  
Thanks for all the help Mark @warkolm  
Also last thing, since this is an unindexed field, will i be able to apply filters to it?

 ![map](https://us1.discourse-cdn.com/elastic/original/3X/b/6/b6c4fbc546a45bbf358489c2f331d0c280b5f445.PNG)

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [October 9, 2017, 4:42am UTC](https://discuss.elastic.co/t/geo-point-unindexed/102700/20 "2017-10-09T04:42:38Z")

</div>

Yes you can apply filters to it.

[Next page](https://discuss.elastic.co/t/geo-point-unindexed/102700.md?page=2)
