# Mapping order effecting whether or not a field is indexed?

**URL:** <https://discuss.elastic.co/t/mapping-order-effecting-whether-or-not-a-field-is-indexed/14818>\
**Category:** Elasticsearch\
**Created:** [December 11, 2013, 3:57pm UTC](https://discuss.elastic.co/t/mapping-order-effecting-whether-or-not-a-field-is-indexed/14818 "2013-12-11T15:57:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brian\_Hudson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brian_hudson/32/1306_2.png) [@Brian\_Hudson](https://discuss.elastic.co/u/Brian_Hudson)\
**Post date:** [December 11, 2013, 3:57pm UTC](https://discuss.elastic.co/t/mapping-order-effecting-whether-or-not-a-field-is-indexed/14818/1 "2013-12-11T15:57:57Z")

</div>

In my mapping I have a field named speed (type double). I also have a field  
named location (type geo\_point). If I include speed in my mapping before  
location, I can query and sort by speed. However, if I include speed in my  
mapping after location querying on speed returns no results and attempts to  
sort on speed fail (all sort values are -Infinity).

Are there any known issues with mappings which occur after a geo\_point  
field mapping? I seem to be able to work around the issue for now by  
ensuring I map geo\_points last.

Broken mapping: queries against speed return no results, sorting fails  
(silently), all sort values are -Infinity:

{  
"event" : {  
"properties": {  
"n": {  
"type": "string",  
"omit\_norms": true,  
"index\_options": "docs"  
}  
"location": {  
"type": "geo\_point",  
"lat\_lon": true  
}  
"speed": { "type": "float" }  
"$speed: {  
"type": "string",  
"omit\_norms": true,  
"index\_options": "docs"  
}  
"-mission": {  
"type": "string",  
"omit\_norms": true,  
"index\_options": "docs"  
}  
"-type": {  
"type": "string",  
"omit\_norms": true,  
"index\_options": "docs"  
}  
"-key": {  
"type": "string",  
"omit\_norms": true,  
"index\_options": "docs"  
}  
"-date": { "type": "long" }  
"-tod": { "type": "long" }  
"-time": { "type": "long" )  
"-dow": {  
"type": "string",  
"omit\_norms": true,  
"index\_options": "docs"  
}  
"#location": {  
"type": "geo\_point",  
"lat\_lon": true  
}  
}  
}  
}

Working mapping: speed mapped before location, queries and sorting  
involving speed working correctly:  
{  
"event" : {  
"properties": {  
"n": {  
"type": "string",  
"omit\_norms": true,  
"index\_options": "docs"  
}  
"speed": { "type": "float" }  
"$speed: {  
"type": "string",  
"omit\_norms": true,  
"index\_options": "docs"  
} "location": {  
"type": "geo\_point",  
"lat\_lon": true  
}  
"-mission": {  
"type": "string",  
"omit\_norms": true,  
"index\_options": "docs"  
}  
"-type": {  
"type": "string",  
"omit\_norms": true,  
"index\_options": "docs"  
}  
"-key": {  
"type": "string",  
"omit\_norms": true,  
"index\_options": "docs"  
}  
"-date": { "type": "long" }  
"-tod": { "type": "long" }  
"-time": { "type": "long" )  
"-dow": {  
"type": "string",  
"omit\_norms": true,  
"index\_options": "docs"  
}  
"#location": {  
"type": "geo\_point",  
"lat\_lon": true  
}  
}  
}  
}

--  
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/78112d3d-0217-4d17-801e-b63f071ce540%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/78112d3d-0217-4d17-801e-b63f071ce540%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:01am UTC](https://discuss.elastic.co/t/mapping-order-effecting-whether-or-not-a-field-is-indexed/14818/2 "2017-07-06T02:01:57Z")

</div>

Closed on July 6, 2017, 2:01am UTC


