In search results, if I change the sort order, the results counts are changing. But the results count should not change when we change the sort order.So can anyone say why this happens in sharepoint and how to resolve it.
The count returned for search results is not an accurate number. That is why it says "About X results". Every time you change pages, the query is executed and SharePoint takes another guess at how many results are found, even though the query has not changed.
Take a look here.
On each post back, search API’s are called by OOB search results pagination controls and SharePoint returns different search counts for same query.
A possibile solution is described here: to replace one of the display templates with a custom one, which uses client side caching to store the search results count of the first page and use it for the remaining pages.