Skip to content

Commit

Permalink
Merge pull request ezsystems#1101 from ezsystems/fix-EZP-23129-sort-f…
Browse files Browse the repository at this point in the history
…iltering

Fix EZP-23129: sorting by field filters the result set
  • Loading branch information
yannickroger committed Dec 17, 2014
2 parents 6d51de6 + fd4ca2d commit 5f97067
Show file tree
Hide file tree
Showing 25 changed files with 1,303 additions and 291 deletions.
50 changes: 50 additions & 0 deletions eZ/Publish/API/Repository/Tests/SearchServiceTest.php
Expand Up @@ -1133,6 +1133,56 @@ function ( $a, $b )
),
$fixtureDir . 'SortFolderName.php',
),
array(
array(
'filter' => new Criterion\ContentTypeId( array( 1, 3 ) ),
'offset' => 0,
'limit' => null,
'sortClauses' => array(
new SortClause\Field( "folder", "name", Query::SORT_ASC, "eng-US" ),
new SortClause\ContentId(),
)
),
$fixtureDir . 'SortFieldMultipleTypes.php',
),
array(
array(
'filter' => new Criterion\ContentTypeId( array( 1, 3 ) ),
'offset' => 0,
'limit' => null,
'sortClauses' => array(
new SortClause\Field( "folder", "name", Query::SORT_DESC, "eng-US" ),
new SortClause\ContentId(),
)
),
$fixtureDir . 'SortFieldMultipleTypesReverse.php',
),
array(
array(
'filter' => new Criterion\ContentTypeId( array( 1, 3 ) ),
'offset' => 3,
'limit' => 5,
'sortClauses' => array(
new SortClause\Field( "folder", "name", Query::SORT_ASC, "eng-US" ),
new SortClause\Field( "user", "first_name", Query::SORT_ASC, "eng-US" ),
new SortClause\ContentId(),
)
),
$fixtureDir . 'SortFieldMultipleTypesSlice.php',
),
array(
array(
'filter' => new Criterion\ContentTypeId( array( 1, 3 ) ),
'offset' => 3,
'limit' => 5,
'sortClauses' => array(
new SortClause\Field( "folder", "name", Query::SORT_DESC, "eng-US" ),
new SortClause\Field( "user", "first_name", Query::SORT_ASC, "eng-US" ),
new SortClause\ContentId(),
)
),
$fixtureDir . 'SortFieldMultipleTypesSliceReverse.php',
),
);
}

Expand Down
@@ -0,0 +1,148 @@
<?php

return eZ\Publish\API\Repository\Values\Content\Search\SearchResult::__set_state(array(
'facets' =>
array (
),
'searchHits' =>
array (
0 =>
eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(array(
'valueObject' =>
array (
'id' => 56,
'title' => 'Design',
),
'score' => 1.0,
'index' => NULL,
'highlight' => NULL,
)),
1 =>
eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(array(
'valueObject' =>
array (
'id' => 50,
'title' => 'Files',
),
'score' => 1.0,
'index' => NULL,
'highlight' => NULL,
)),
2 =>
eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(array(
'valueObject' =>
array (
'id' => 49,
'title' => 'Images',
),
'score' => 1.0,
'index' => NULL,
'highlight' => NULL,
)),
3 =>
eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(array(
'valueObject' =>
array (
'id' => 41,
'title' => 'Media',
),
'score' => 1.0,
'index' => NULL,
'highlight' => NULL,
)),
4 =>
eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(array(
'valueObject' =>
array (
'id' => 51,
'title' => 'Multimedia',
),
'score' => 1.0,
'index' => NULL,
'highlight' => NULL,
)),
5 =>
eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(array(
'valueObject' =>
array (
'id' => 45,
'title' => 'Setup',
),
'score' => 1.0,
'index' => NULL,
'highlight' => NULL,
)),
6 =>
eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(array(
'valueObject' =>
array (
'id' => 4,
'title' => 'Users',
),
'score' => 1.0,
'index' => NULL,
'highlight' => NULL,
)),
7 =>
eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(array(
'valueObject' =>
array (
'id' => 11,
'title' => 'Members',
),
'score' => 1.0,
'index' => NULL,
'highlight' => NULL,
)),
8 =>
eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(array(
'valueObject' =>
array (
'id' => 12,
'title' => 'Administrator users',
),
'score' => 1.0,
'index' => NULL,
'highlight' => NULL,
)),
9 =>
eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(array(
'valueObject' =>
array (
'id' => 13,
'title' => 'Editors',
),
'score' => 1.0,
'index' => NULL,
'highlight' => NULL,
)),
10 =>
eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(array(
'valueObject' =>
array (
'id' => 42,
'title' => 'Anonymous Users',
),
'score' => 1.0,
'index' => NULL,
'highlight' => NULL,
)),
11 =>
eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(array(
'valueObject' =>
array (
'id' => 59,
'title' => 'Partners',
),
'score' => 1.0,
'index' => NULL,
'highlight' => NULL,
)),

),
'spellSuggestion' => NULL,
'time' => 1,
'timedOut' => NULL,
'maxScore' => 1.0,
'totalCount' => 12,
));
@@ -0,0 +1,148 @@
<?php

return eZ\Publish\API\Repository\Values\Content\Search\SearchResult::__set_state(array(
'facets' =>
array (
),
'searchHits' =>
array (
0 =>
eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(array(
'valueObject' =>
array (
'id' => 45,
'title' => 'Setup',
),
'score' => 1.0,
'index' => NULL,
'highlight' => NULL,
)),
1 =>
eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(array(
'valueObject' =>
array (
'id' => 51,
'title' => 'Multimedia',
),
'score' => 1.0,
'index' => NULL,
'highlight' => NULL,
)),
2 =>
eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(array(
'valueObject' =>
array (
'id' => 41,
'title' => 'Media',
),
'score' => 1.0,
'index' => NULL,
'highlight' => NULL,
)),
3 =>
eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(array(
'valueObject' =>
array (
'id' => 49,
'title' => 'Images',
),
'score' => 1.0,
'index' => NULL,
'highlight' => NULL,
)),
4 =>
eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(array(
'valueObject' =>
array (
'id' => 50,
'title' => 'Files',
),
'score' => 1.0,
'index' => NULL,
'highlight' => NULL,
)),
5 =>
eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(array(
'valueObject' =>
array (
'id' => 56,
'title' => 'Design',
),
'score' => 1.0,
'index' => NULL,
'highlight' => NULL,
)),
6 =>
eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(array(
'valueObject' =>
array (
'id' => 4,
'title' => 'Users',
),
'score' => 1.0,
'index' => NULL,
'highlight' => NULL,
)),
7 =>
eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(array(
'valueObject' =>
array (
'id' => 11,
'title' => 'Members',
),
'score' => 1.0,
'index' => NULL,
'highlight' => NULL,
)),
8 =>
eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(array(
'valueObject' =>
array (
'id' => 12,
'title' => 'Administrator users',
),
'score' => 1.0,
'index' => NULL,
'highlight' => NULL,
)),
9 =>
eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(array(
'valueObject' =>
array (
'id' => 13,
'title' => 'Editors',
),
'score' => 1.0,
'index' => NULL,
'highlight' => NULL,
)),
10 =>
eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(array(
'valueObject' =>
array (
'id' => 42,
'title' => 'Anonymous Users',
),
'score' => 1.0,
'index' => NULL,
'highlight' => NULL,
)),
11 =>
eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(array(
'valueObject' =>
array (
'id' => 59,
'title' => 'Partners',
),
'score' => 1.0,
'index' => NULL,
'highlight' => NULL,
)),

),
'spellSuggestion' => NULL,
'time' => 1,
'timedOut' => NULL,
'maxScore' => 1.0,
'totalCount' => 12,
));

0 comments on commit 5f97067

Please sign in to comment.