Here is my Java code. skip missing some records. also order is not working.
AggregateIterable<Document> propertiesDoc = collection.aggregate(Arrays.asList(
Aggregates.match(queryNew),
Aggregates.group("$similarGroup", Accumulators.sum("count", 1),Accumulators.first("data", "$$ROOT")),
Aggregates.skip(skipCount),
Aggregates.limit(searchRequest.getItemsPerPage()),
Aggregates.sort(descending("salePrice")))
);
I found solution. there was multiple issues.