fixed problem with sorting by id in elasticsearch

issue #1317