sort documents, own namespace first