Fixed ElasticSearch sort issue.

refs #5972

Fixed an issue with ElasticSearch not being able to sort if certain
data was indexed.