Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-23129

Search API: sorting by field filters the results

    Details

      Description

      Applying a Field sortClause to a query will filter the search results to contents of that type.

      The expected result would be that sort clauses would only sort results

      Steps to reproduce:

      Verify that the following command snippet, that searches content belonging to section 1 ("Standard") only returns contents of type "folder"

              // query criterion       
              $query->criterion = new Criterion\SectionId( array( 1 ) );
       
              // apply sort clauses
              $query->sortClauses = array(
                  new SortClause\Field( 'folder', 'title', SearchQuery::SORT_ASC, 'eng-GB' )
              );
       
              // find content
              $result = $searchService->findContent( $query );
       
              foreach ( $result->searchHits as $searchHit )
                  $output->writeln( '* ' . $searchHit->valueObject->contentInfo->name );
      

        Activity

        Show
        Joao Inacio (Inactive) added a comment - PR with tests: https://github.com/ezsystems/ezpublish-kernel/pull/919
        Show
        Petar Spanja (Inactive) added a comment - New pull request: https://github.com/ezsystems/ezpublish-kernel/pull/1101
        Hide
        Yannick Roger (Inactive) added a comment -

        Fixed in master (lots of commits so pasting the PR's diff): https://github.com/ezsystems/ezpublish-kernel/pull/1101.diff

        Show
        Yannick Roger (Inactive) added a comment - Fixed in master (lots of commits so pasting the PR's diff): https://github.com/ezsystems/ezpublish-kernel/pull/1101.diff
        Hide
        Rui Silva (Inactive) added a comment -

        Tested and approved by QA, for master, 5.4 and 5.3.

        Show
        Rui Silva (Inactive) added a comment - Tested and approved by QA, for master, 5.4 and 5.3.

          People

          • Assignee:
            Unassigned
            Reporter:
            Joao Inacio (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 3 days, 5 hours, 35 minutes
              3d 5h 35m