Better countBy for generic entities
Added a distinct count for count SearchBy
Merge branch 'feature/better_countby' into develop