pimcore / generic-data-index-bundle

Other
3 stars 1 forks source link

Refactor SearchService #69

Closed martineiber closed 4 months ago

martineiber commented 4 months ago

Changes in this pull request

Resolves #

Additional info

This pr removes the AbstractSearchService and refactors the existing AssetSearchService to comply with the updated SearchServiceInterface. As part of this, it adds a new method 'performSearch' inside the AssetSearchService. Also, this introduces a new SearchProvider and SearchProviderInterface to create different types of searches. An exception has been added for invalid page and page size in PaginatedSearchTrait. Corresponding tests have been added to ensure the accuracy of changes.

Usage of Search Provider:

public function testingAction(SearchProviderInterface $searchProvider, AssetSearchServiceInterface $assetSearchService)
 {
        $assetSearch = $searchProvider->createAssetSearch()
            ->addModifier(new ParentIdFilter(1))
            ->addModifier(new OrderByFullPath())
            ->setPageSize(50)
            ->setPage(1);

        $searchResult = $assetSearchService->search($assetSearch);
}
github-actions[bot] commented 4 months ago

Qodana for PHP

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked ☁️ View the detailed Qodana report

Contact Qodana team Contact us at [qodana-support@jetbrains.com](mailto:qodana-support@jetbrains.com) - Or via our issue tracker: https://jb.gg/qodana-issue - Or share your feedback: https://jb.gg/qodana-discussions