LPS-47551 Fix of the search and ordering when 'Limit membership to members of the parent site' is enabled.

cc/ @ligasm. Hey @juliocamarero, sending to you after 'https://github.com/jorgeferrer/liferay-portal/pull/440' was closed. Could you please review it? Thanks