Customize the result of filter

Hi

Is it possible with filters to get the data in a desired order.

For example I have a filter like

Filter : “Documnent Id” : “1” OR “Document Id” : “2” OR "Document Id ": 3 OR Document Type : “XYZ

This filter will return me documents with id 1,2,3 and all other documents whcih has Document Type XYZ.

But my requirement here is to get the data in this order Documents of id 1,2,3 (should be first 3 documents in the list ) and all other documents of types XYZ should be after them.

I have a list if these id’s which I want to render first.

See below what I am looking for.

Document id 1
Documen id 2
Document id 3
Document of TYPE XYZ
Document of TYPE XYZ
.
.
.
Document Type XYZ

Thanks
Aman