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.
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).
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.