Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IBX-6338: As an Editor I'd like to sort the list of search results #25

Merged
merged 12 commits into from
Sep 15, 2023

Conversation

adamwojs
Copy link
Member

@adamwojs adamwojs commented Aug 12, 2023

Question Answer
Tickets IBX-6338
Bug fix? no
New feature? yes
BC breaks? no
Tests pass? yes
Doc needed? yes
License GPL-2.0

Backend for sorting results in Global Search.

Custom Sorting Definitions

  1. Implement \Ibexa\Contracts\Search\SortingDefinition\SortingDefintionProviderInterface
namespace App\Search\SortingDefintion;

use Ibexa\Contracts\Search\SortingDefinition\SortingDefinition;

final class RandomSortingDefintionProvider implements SortingDefintionProviderInterface
{
    public function getSortingDefinitions(): array
    {
        return [
            new SortingDefinition(
                'random',
                'Random sort',
                [
                    new Random(),
                ],
                900
            ),
        ]; 
    }
}
  1. Register service with ibexa.search.sorting_definition.provider tag
services:
    # ...
    App\Search\SortingDefintion\RandomSortingDefintionProvider:
        tags:
            -   name: ibexa.search.sorting_definition.provider

Checklist:

  • Implement tests
  • Coding standards ($ composer fix-cs)

@webhdx webhdx requested a review from a team August 21, 2023 06:37
@webhdx webhdx added Feature New feature request Ready for review labels Aug 21, 2023
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 5 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants