ECMS-6444 : fix pagination problems in search

It should be a new constructor.