class EcoNewsServiceImpl implements EcoNewsService {

    @Override
    public PageableDto<SearchNewsDto> search(String searchQuery) {
        Page<EcoNews> page = ecoNewsRepo.searchEcoNews(PageRequest.of(0, 3), searchQuery);

        List<SearchNewsDto> ecoNews = page.stream()
                .map(ecoNews1 -> modelMapper.map(ecoNews1, SearchNewsDto.class))
                .collect(Collectors.toList());

        return new PageableDto<>(
            ecoNews,
            page.getTotalElements(),
            page.getPageable().getPageNumber(),
            page.getTotalPages()
        );
    }

}