How to sort data from 2 different types of custom posts, having some common fields- before displayin


I have 2 different types of custom posts- each having their own different sets of data, in a wordpress site.

Now, these 2 post types have 3-4 common fields, I wish to show the data from combined set of custom posts-- depending on some search criteria as entered by the user- and also sort the combined data (again on a common field specified by the user)

How do I search both data sets together+ combine their data by sorting them with a common field, before showing the data?

Yours sincerely,