you can go to the following blog,
here I have explained how to implement filter and search functions,
Now, For two entities, you can use two different list views and put them into the same dataview and then
use the implementation, this way you will achieve your requirement.
Let me know if you face any issues,
Hope it helps!