Same query, sort with one field and sort with two fields get different results


(Makeyang) #1

response1 = client.prepareSearch(index)
.setTypes("orderProdCommentImgInfo")
.setSearchType(SearchType.QUERY_THEN_FETCH)
.setQuery(query)
.setFrom(0).setSize(60)
.addSort("createTime", SortOrder.ASC)
.execute()
.actionGet();
response2 = client.prepareSearch(index)
.setTypes("orderProdCommentImgInfo")
.setSearchType(SearchType.QUERY_THEN_FETCH)
.setQuery(query)
.setFrom(0).setSize(60)
.addSort("createTime", SortOrder.ASC)
.addSort("imgPosition", SortOrder.ASC)
.execute()
.actionGet();

response1 get 9 results with response2 get 8.
any clue why this happens?


(system) #2