fixing documents search sorting