[ES 1.7.1] Sort is not working for mapped field (long)

Hi.

I've got field mapping:

"created":{"type":"float","include_in_all":true}

I'm executing a bool query which ha sort part:

  "sort" : [ 
              {
                "created" : {
                              "order" : "desc"
                            }
              } 
]

And in the response I get:

Parse Failure [No mapping found for [created] in order to sort on]];

Why I get this? If I'm adding a "unmapped_type":"long", I don't get that error but I get results in wrong order

Can you reproduce that with a simple script ?

May be incorrect mapping?

What do you mean with a simple script ?

Mapping is correct (in my opionion) as I checked it with mapping API and in the response I get what I pasted in the first post.

This is my mapping:

"mappings": {
		"myIndex": {
			"_id": {
				"path": "documentId"
			},
			"properties": {
				"documentId": {
					"type": "string",
					"include_in_all": false,
					"index": "not_analyzed"
				}
				"created": {
					"type": "float",
					"include_in_all": true
				}
			}
 		}
	}

I meant that: https://www.elastic.co/help

https://gist.github.com/Emteka/561d08ba081108d46afa

This is a simple script, and sorting is not working for me.
Result should be:
4
1
2
3
And I get them in the same order all the time

UPDATE:
To get the error from post one please use thise query:

curl -XPOST 'author.local.telegraph.co.uk:9200/_search' -d '{
"query" : {
			"match_phrase_prefix": {"field1":"kimchy"}
},
"sort" : [
   {"fieldForSort" : {"order" : "desc"}}
]
}'

The mapping you provided applies to type 'asset' but you are indexing into type 'tweet', and 'fieldForSort' is therefore mapped as a string. Once I changed 'asset' to 'tweet' in the template it seemed to work and return the expected order.

Good spot. I checked mine applicaiton code, (I'm using java Search API), and type is set properly. Can I check if the mapping was used for certain query?

I tried to add explain to the query but results say nothing to me.

Ehh kill me.

My field was set to float, instead of long. Sorting wasn't working because of that (I saved my documents with long value instead of float, so the mapping didn't applied).

Tahnk you everyone for help and tips!