backport search in shared files to stable5

backport of https://github.com/owncloud/core/pull/4207