Closes #1903. Results are returned in the order that elasticsearch sends them. That is, in descending order with the biggest values first. Changed the index which is recorded from the highest to the lowest. So the lowest index position is taken for an x value instead of the highest. In addition, we were not actually sorting by indexed position before, so this fixes that bug.