# GeoPoint mapping Option

**URL:** <https://discuss.elastic.co/t/geopoint-mapping-option/7702>\
**Category:** Elasticsearch\
**Created:** [May 15, 2012, 9:03am UTC](https://discuss.elastic.co/t/geopoint-mapping-option/7702 "2012-05-15T09:03:22Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stanislas\_Polu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stanislas_polu/32/2873_2.png) [@Stanislas\_Polu](https://discuss.elastic.co/u/Stanislas_Polu)\
**Post date:** [May 15, 2012, 9:03am UTC](https://discuss.elastic.co/t/geopoint-mapping-option/7702/1 "2012-05-15T09:03:22Z")

</div>

Hi,

There's very little information about the geopoint "lat\_lon" indexation  
option.  
Can someone describe how queries are leveraging so that I can get a better  
understanding of whether that would be helpful in my case?

- there's also little information on how to pass an option to the geopoint  
mapping is this:

$ curl -XPUT '[http://localhost:9200/twitter/tweet/\_mapping](http://localhost:9200/twitter/tweet/_mapping)' -d '

{  
"tweet" : {  
"properties" : {  
"message" : {"type" : "string", "store" : "yes", "lat\_lon": "true"}

```
    }
}

```

}  
'

Cheers,

-stan

--  
Stanislas Polu  
Mo: +33 6 83 71 90 04 | Tw: @spolu | [http://teleportd.com](http://teleportd.com) | Realtime Photo  
Search

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [May 17, 2012, 8:32pm UTC](https://discuss.elastic.co/t/geopoint-mapping-option/7702/2 "2012-05-17T20:32:22Z")

</div>

First, you don't need to store the field. Second, by default, when the  
lat\_lon are not indexed, the values are loaded to memory and used for geo  
calculations in memory (like checking bounding boxes, distances and the  
like). For things that can use lat\_lon that are indexed (like bounding  
boxes), then you can configure the relevant geo filter to the the "checks"  
instead of in memory, using the indexed lat\_lon. Most times, the in memory  
option is the one you want.

On Tue, May 15, 2012 at 12:03 PM, Stanislas Polu  
[polu.stanislas@gmail.com](mailto:polu.stanislas@gmail.com)wrote:

> Hi,
> 
> There's very little information about the geopoint "lat\_lon" indexation  
> option.  
> Can someone describe how queries are leveraging so that I can get a better  
> understanding of whether that would be helpful in my case?
> 
> - there's also little information on how to pass an option to the geopoint  
> mapping is this:
> 
> $ curl -XPUT '[http://localhost:9200/twitter/tweet/\_mapping](http://localhost:9200/twitter/tweet/_mapping)' -d '
> 
> {  
> "tweet" : {  
> "properties" : {  
> "message" : {"type" : "string", "store" : "yes", "lat\_lon": "true"}
> 
> ```
> }
> }
> 
> ```
> 
> }  
> '
> 
> Cheers,
> 
> -stan
> 
> --  
> Stanislas Polu  
> Mo: +33 6 83 71 90 04 | Tw: @spolu | [http://teleportd.com](http://teleportd.com) | Realtime  
> Photo Search

---

<div class="post-metadata">

**Author:** ![Stanislas\_Polu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stanislas_polu/32/2873_2.png) [@Stanislas\_Polu](https://discuss.elastic.co/u/Stanislas_Polu)\
**Post date:** [May 21, 2012, 10:41am UTC](https://discuss.elastic.co/t/geopoint-mapping-option/7702/3 "2012-05-21T10:41:49Z")

</div>

Hi Everyone,

How can one pass arguments to a mapping?  
such as the 'lat\_lon': 'true' option for the GeoPoint mapping?

Best,

-stan

--  
Stanislas Polu  
Mo: +33 6 83 71 90 04 | Tw: @spolu | [http://teleportd.com](http://teleportd.com) | Realtime Photo  
Search

On Tue, May 15, 2012 at 11:03 AM, Stanislas Polu  
[polu.stanislas@gmail.com](mailto:polu.stanislas@gmail.com)wrote:

> Hi,
> 
> There's very little information about the geopoint "lat\_lon" indexation  
> option.  
> Can someone describe how queries are leveraging so that I can get a better  
> understanding of whether that would be helpful in my case?
> 
> - there's also little information on how to pass an option to the geopoint  
> mapping is this:
> 
> $ curl -XPUT '[http://localhost:9200/twitter/tweet/\_mapping](http://localhost:9200/twitter/tweet/_mapping)' -d '
> 
> {  
> "tweet" : {  
> "properties" : {  
> "message" : {"type" : "string", "store" : "yes", "lat\_lon": "true"}
> 
> ```
> }
> }
> 
> ```
> 
> }  
> '
> 
> Cheers,
> 
> -stan
> 
> --  
> Stanislas Polu  
> Mo: +33 6 83 71 90 04 | Tw: @spolu | [http://teleportd.com](http://teleportd.com) | Realtime  
> Photo Search

---

<div class="post-metadata">

**Author:** ![Stanislas\_Polu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stanislas_polu/32/2873_2.png) [@Stanislas\_Polu](https://discuss.elastic.co/u/Stanislas_Polu)\
**Post date:** [May 21, 2012, 12:57pm UTC](https://discuss.elastic.co/t/geopoint-mapping-option/7702/4 "2012-05-21T12:57:03Z")

</div>

Hmmm I had missed your reply! Thanks!

I understand I should stick with in-memory. I still have a couples  
questions for the sake of it:

- When is the field loaded in memory? on-demand I presume. Is it loaded  
entirely (meaning first request might be slow and all subsequent geo  
constrained requests are fast)
- How does one configure a mapping in the PUT mapping API. I mean the  
syntax is not clear from the website.

Best,

-stan

On Thursday, May 17, 2012 10:32:22 PM UTC+2, kimchy wrote:

> First, you don't need to store the field. Second, by default, when the  
> lat\_lon are not indexed, the values are loaded to memory and used for geo  
> calculations in memory (like checking bounding boxes, distances and the  
> like). For things that can use lat\_lon that are indexed (like bounding  
> boxes), then you can configure the relevant geo filter to the the "checks"  
> instead of in memory, using the indexed lat\_lon. Most times, the in memory  
> option is the one you want.
> 
> On Tue, May 15, 2012 at 12:03 PM, Stanislas Polu \<[polu.stanislas@gmail.com](mailto:polu.stanislas@gmail.com)
> 
> > wrote:
> 
> > Hi,
> > 
> > There's very little information about the geopoint "lat\_lon" indexation  
> > option.  
> > Can someone describe how queries are leveraging so that I can get a  
> > better understanding of whether that would be helpful in my case?
> > 
> > - there's also little information on how to pass an option to the  
> > geopoint mapping is this:
> > 
> > $ curl -XPUT '[http://localhost:9200/twitter/tweet/\_mapping](http://localhost:9200/twitter/tweet/_mapping)' -d '
> > 
> > {  
> > "tweet" : {  
> > "properties" : {  
> > "message" : {"type" : "string", "store" : "yes", "lat\_lon": "true"}
> > 
> > ```
> > }
> > }
> > 
> > ```
> > 
> > }  
> > '
> > 
> > Cheers,
> > 
> > -stan
> > 
> > --  
> > Stanislas Polu  
> > Mo: +33 6 83 71 90 04 | Tw: @spolu | [http://teleportd.com](http://teleportd.com) | Realtime  
> > Photo Search

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [May 23, 2012, 9:35pm UTC](https://discuss.elastic.co/t/geopoint-mapping-option/7702/5 "2012-05-23T21:35:06Z")

</div>

On Mon, May 21, 2012 at 2:57 PM, Stanislas Polu [polu.stanislas@gmail.com](mailto:polu.stanislas@gmail.com)wrote:

> Hmmm I had missed your reply! Thanks!
> 
> I understand I should stick with in-memory. I still have a couples  
> questions for the sake of it:
> 
> - When is the field loaded in memory? on-demand I presume. Is it loaded  
> entirely (meaning first request might be slow and all subsequent geo  
> constrained requests are fast)

It is loaded entirely on the first request. In upcoming 0.20 you will be  
able to register warmup searches that will make loading (specifically for  
new data coming in) faster and less disruptive on the search experience.

> - How does one configure a mapping in the PUT mapping API. I mean the  
> syntax is not clear from the website.

Not really sure what the question is here..., what do you not understand?  
Maybe gist a sample of what you try and not working so we can fix it.

> Best,
> 
> -stan
> 
> On Thursday, May 17, 2012 10:32:22 PM UTC+2, kimchy wrote:
> 
> > First, you don't need to store the field. Second, by default, when the  
> > lat\_lon are not indexed, the values are loaded to memory and used for geo  
> > calculations in memory (like checking bounding boxes, distances and the  
> > like). For things that can use lat\_lon that are indexed (like bounding  
> > boxes), then you can configure the relevant geo filter to the the "checks"  
> > instead of in memory, using the indexed lat\_lon. Most times, the in memory  
> > option is the one you want.
> > 
> > On Tue, May 15, 2012 at 12:03 PM, Stanislas Polu \<  
> > [polu.stanislas@gmail.com](mailto:polu.stanislas@gmail.com)\> wrote:
> > 
> > > Hi,
> > > 
> > > There's very little information about the geopoint "lat\_lon" indexation  
> > > option.  
> > > Can someone describe how queries are leveraging so that I can get a  
> > > better understanding of whether that would be helpful in my case?
> > > 
> > > - there's also little information on how to pass an option to the  
> > > geopoint mapping is this:
> > > 
> > > $ curl -XPUT '[http://localhost:9200/\*\*twitter/tweet/\_mapping](http://localhost:9200/**twitter/tweet/_mapping) [http://localhost:9200/twitter/tweet/\_mapping](http://localhost:9200/twitter/tweet/_mapping)' -d '
> > > 
> > > {  
> > > "tweet" : {  
> > > "properties" : {  
> > > "message" : {"type" : "string", "store" : "yes", "lat\_lon": "true"}
> > > 
> > > ```
> > > }
> > > }
> > > 
> > > ```
> > > 
> > > }  
> > > '
> > > 
> > > Cheers,
> > > 
> > > -stan
> > > 
> > > --  
> > > Stanislas Polu  
> > > Mo: +33 6 83 71 90 04 | Tw: @spolu | [http://teleportd.com](http://teleportd.com) | \*\*Realtime  
> > > Photo Search

---

<div class="post-metadata">

**Author:** ![Stanislas\_Polu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stanislas_polu/32/2873_2.png) [@Stanislas\_Polu](https://discuss.elastic.co/u/Stanislas_Polu)\
**Post date:** [May 31, 2012, 8:15am UTC](https://discuss.elastic.co/t/geopoint-mapping-option/7702/6 "2012-05-31T08:15:02Z")

</div>

If I were to use the lat\_lon indexing option (which I'm not as per our  
previous discussion). How would I configure the field to do so. Would it be  
that way?

> <https://gist.github.com/spolu/2841825>

Best,

-stan

--  
Stanislas Polu  
Mo: +33 6 83 71 90 04 | Tw: @spolu | [http://teleportd.com](http://teleportd.com) | Realtime Photo  
Search

On Wed, May 23, 2012 at 11:35 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:

> On Mon, May 21, 2012 at 2:57 PM, Stanislas Polu [polu.stanislas@gmail.com](mailto:polu.stanislas@gmail.com)wrote:
> 
> > Hmmm I had missed your reply! Thanks!
> > 
> > I understand I should stick with in-memory. I still have a couples  
> > questions for the sake of it:
> > 
> > - When is the field loaded in memory? on-demand I presume. Is it loaded  
> > entirely (meaning first request might be slow and all subsequent geo  
> > constrained requests are fast)
> 
> It is loaded entirely on the first request. In upcoming 0.20 you will be  
> able to register warmup searches that will make loading (specifically for  
> new data coming in) faster and less disruptive on the search experience.
> 
> > - How does one configure a mapping in the PUT mapping API. I mean the  
> > syntax is not clear from the website.
> 
> Not really sure what the question is here..., what do you not understand?  
> Maybe gist a sample of what you try and not working so we can fix it.
> 
> > Best,
> > 
> > -stan
> > 
> > On Thursday, May 17, 2012 10:32:22 PM UTC+2, kimchy wrote:
> > 
> > > First, you don't need to store the field. Second, by default, when the  
> > > lat\_lon are not indexed, the values are loaded to memory and used for geo  
> > > calculations in memory (like checking bounding boxes, distances and the  
> > > like). For things that can use lat\_lon that are indexed (like bounding  
> > > boxes), then you can configure the relevant geo filter to the the "checks"  
> > > instead of in memory, using the indexed lat\_lon. Most times, the in memory  
> > > option is the one you want.
> > > 
> > > On Tue, May 15, 2012 at 12:03 PM, Stanislas Polu \<  
> > > [polu.stanislas@gmail.com](mailto:polu.stanislas@gmail.com)\> wrote:
> > > 
> > > > Hi,
> > > > 
> > > > There's very little information about the geopoint "lat\_lon" indexation  
> > > > option.  
> > > > Can someone describe how queries are leveraging so that I can get a  
> > > > better understanding of whether that would be helpful in my case?
> > > > 
> > > > - there's also little information on how to pass an option to the  
> > > > geopoint mapping is this:
> > > > 
> > > > $ curl -XPUT '[http://localhost:9200/\*\*twitter/tweet/\_mapping](http://localhost:9200/**twitter/tweet/_mapping) [http://localhost:9200/twitter/tweet/\_mapping](http://localhost:9200/twitter/tweet/_mapping)' -d '
> > > > 
> > > > {  
> > > > "tweet" : {  
> > > > "properties" : {  
> > > > "message" : {"type" : "string", "store" : "yes", "lat\_lon": "true"}
> > > > 
> > > > ```
> > > > }
> > > > }
> > > > 
> > > > ```
> > > > 
> > > > }  
> > > > '
> > > > 
> > > > Cheers,
> > > > 
> > > > -stan
> > > > 
> > > > --  
> > > > Stanislas Polu  
> > > > Mo: +33 6 83 71 90 04 | Tw: @spolu | [http://teleportd.com](http://teleportd.com) | \*\*Realtime  
> > > > Photo Search

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [June 3, 2012, 9:20am UTC](https://discuss.elastic.co/t/geopoint-mapping-option/7702/7 "2012-06-03T09:20:36Z")

</div>

Yes.

On Thu, May 31, 2012 at 10:15 AM, Stanislas Polu  
[polu.stanislas@gmail.com](mailto:polu.stanislas@gmail.com)wrote:

> If I were to use the lat\_lon indexing option (which I'm not as per our  
> previous discussion). How would I configure the field to do so. Would it be  
> that way?
> 
> [gist:2841825 · GitHub](https://gist.github.com/2841825)
> 
> Best,
> 
> -stan
> 
> --  
> Stanislas Polu  
> Mo: +33 6 83 71 90 04 | Tw: @spolu | [http://teleportd.com](http://teleportd.com) | Realtime  
> Photo Search
> 
> On Wed, May 23, 2012 at 11:35 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> 
> > On Mon, May 21, 2012 at 2:57 PM, Stanislas Polu \<[polu.stanislas@gmail.com](mailto:polu.stanislas@gmail.com)
> > 
> > > wrote:
> > 
> > > Hmmm I had missed your reply! Thanks!
> > > 
> > > I understand I should stick with in-memory. I still have a couples  
> > > questions for the sake of it:
> > > 
> > > - When is the field loaded in memory? on-demand I presume. Is it loaded  
> > > entirely (meaning first request might be slow and all subsequent geo  
> > > constrained requests are fast)
> > 
> > It is loaded entirely on the first request. In upcoming 0.20 you will be  
> > able to register warmup searches that will make loading (specifically for  
> > new data coming in) faster and less disruptive on the search experience.
> > 
> > > - How does one configure a mapping in the PUT mapping API. I mean the  
> > > syntax is not clear from the website.
> > 
> > Not really sure what the question is here..., what do you not understand?  
> > Maybe gist a sample of what you try and not working so we can fix it.
> > 
> > > Best,
> > > 
> > > -stan
> > > 
> > > On Thursday, May 17, 2012 10:32:22 PM UTC+2, kimchy wrote:
> > > 
> > > > First, you don't need to store the field. Second, by default, when the  
> > > > lat\_lon are not indexed, the values are loaded to memory and used for geo  
> > > > calculations in memory (like checking bounding boxes, distances and the  
> > > > like). For things that can use lat\_lon that are indexed (like bounding  
> > > > boxes), then you can configure the relevant geo filter to the the "checks"  
> > > > instead of in memory, using the indexed lat\_lon. Most times, the in memory  
> > > > option is the one you want.
> > > > 
> > > > On Tue, May 15, 2012 at 12:03 PM, Stanislas Polu \<  
> > > > [polu.stanislas@gmail.com](mailto:polu.stanislas@gmail.com)\> wrote:
> > > > 
> > > > > Hi,
> > > > > 
> > > > > There's very little information about the geopoint "lat\_lon"  
> > > > > indexation option.  
> > > > > Can someone describe how queries are leveraging so that I can get a  
> > > > > better understanding of whether that would be helpful in my case?
> > > > > 
> > > > > - there's also little information on how to pass an option to the  
> > > > > geopoint mapping is this:
> > > > > 
> > > > > $ curl -XPUT '[http://localhost:9200/\*\*twitter/tweet/\_mapping](http://localhost:9200/**twitter/tweet/_mapping) [http://localhost:9200/twitter/tweet/\_mapping](http://localhost:9200/twitter/tweet/_mapping)' -d '
> > > > > 
> > > > > {  
> > > > > "tweet" : {  
> > > > > "properties" : {  
> > > > > "message" : {"type" : "string", "store" : "yes", "lat\_lon": "true"}
> > > > > 
> > > > > ```
> > > > > }
> > > > > }
> > > > > 
> > > > > ```
> > > > > 
> > > > > }  
> > > > > '
> > > > > 
> > > > > Cheers,
> > > > > 
> > > > > -stan
> > > > > 
> > > > > --  
> > > > > Stanislas Polu  
> > > > > Mo: +33 6 83 71 90 04 | Tw: @spolu | [http://teleportd.com](http://teleportd.com) | \*\*Realtime  
> > > > > Photo Search

---

<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, 3:25am UTC](https://discuss.elastic.co/t/geopoint-mapping-option/7702/8 "2017-07-06T03:25:52Z")

</div>


