Options search results are showing in a random manner which is messed up in both TV Dhan and DEXT as of now. I have attached screenshots from Fyers and Kite (0dha) for reference.
It should be ascending order expiry wise
It should be CE PE CE PE order as shown in images below
Currently we show search results based on the volume traded in the contract on the previous day. This is why the list sequence is as per what you shared.
Will take a look into logic shared as per you to make it more relevant moving forward.