Skip to content

Commit

Permalink
Merge pull request #569 from ezsystems/fix-EZP-21719-depth-criterion
Browse files Browse the repository at this point in the history
Implement EZP-21719: Implement LocationDepth search criterion
  • Loading branch information
pspanja committed Nov 1, 2013
2 parents ddc29a7 + 2c82d46 commit d0afef4
Show file tree
Hide file tree
Showing 13 changed files with 919 additions and 3 deletions.
63 changes: 63 additions & 0 deletions eZ/Publish/API/Repository/Tests/SearchServiceTest.php
Expand Up @@ -411,6 +411,69 @@ function ( $a, $b )
),
$fixtureDir . 'LanguageCodeAlwaysAvailable.php',
),
array(
new Query(
array(
'criterion' => new Criterion\Depth( Criterion\Operator::EQ, 1 ),
'sortClauses' => array( new SortClause\ContentId() )
)
),
$fixtureDir . 'Depth.php',
),
array(
new Query(
array(
'criterion' => new Criterion\Depth( Criterion\Operator::IN, array( 1, 3 ) ),
'sortClauses' => array( new SortClause\ContentId() )
)
),
$fixtureDir . 'DepthIn.php',
),
array(
new Query(
array(
'criterion' => new Criterion\Depth( Criterion\Operator::GT, 2 ),
'sortClauses' => array( new SortClause\ContentId() )
)
),
$fixtureDir . 'DepthGt.php',
),
array(
new Query(
array(
'criterion' => new Criterion\Depth( Criterion\Operator::GTE, 2 ),
'sortClauses' => array( new SortClause\ContentId() )
)
),
$fixtureDir . 'DepthGte.php',
),
array(
new Query(
array(
'criterion' => new Criterion\Depth( Criterion\Operator::LT, 2 ),
'sortClauses' => array( new SortClause\ContentId() )
)
),
$fixtureDir . 'Depth.php',
),
array(
new Query(
array(
'criterion' => new Criterion\Depth( Criterion\Operator::LTE, 2 ),
'sortClauses' => array( new SortClause\ContentId() )
)
),
$fixtureDir . 'DepthLte.php',
),
array(
new Query(
array(
'criterion' => new Criterion\Depth( Criterion\Operator::BETWEEN, array( 1, 2 ) ),
'sortClauses' => array( new SortClause\ContentId() )
)
),
$fixtureDir . 'DepthLte.php',
),
);
}

Expand Down
69 changes: 69 additions & 0 deletions eZ/Publish/API/Repository/Tests/_fixtures/Legacy/Depth.php
@@ -0,0 +1,69 @@
<?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' => 4,
'title' => 'Users',
),
'score' => NULL,
'index' => NULL,
'highlight' => NULL,
)
),
1 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 41,
'title' => 'Media',
),
'score' => NULL,
'index' => NULL,
'highlight' => NULL,
)
),
2 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 45,
'title' => 'Setup',
),
'score' => NULL,
'index' => NULL,
'highlight' => NULL,
)
),
3 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 56,
'title' => 'Design',
),
'score' => NULL,
'index' => NULL,
'highlight' => NULL,
)
),
4 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 57,
'title' => 'Home',
),
'score' => NULL,
'index' => NULL,
'highlight' => NULL,
)
),
),
'spellSuggestion' => NULL,
'time' => 1,
'timedOut' => NULL,
'maxScore' => NULL,
'totalCount' => 5,
)
);
36 changes: 36 additions & 0 deletions eZ/Publish/API/Repository/Tests/_fixtures/Legacy/DepthGt.php
@@ -0,0 +1,36 @@
<?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' => 10,
'title' => 'Anonymous User',
),
'score' => NULL,
'index' => NULL,
'highlight' => NULL,
)
),
1 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 14,
'title' => 'Administrator User',
),
'score' => NULL,
'index' => NULL,
'highlight' => NULL,
)
),
),
'spellSuggestion' => NULL,
'time' => 1,
'timedOut' => NULL,
'maxScore' => NULL,
'totalCount' => 2,
)
);
157 changes: 157 additions & 0 deletions eZ/Publish/API/Repository/Tests/_fixtures/Legacy/DepthGte.php
@@ -0,0 +1,157 @@
<?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' => 10,
'title' => 'Anonymous User',
),
'score' => NULL,
'index' => NULL,
'highlight' => NULL,
)
),
1 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 11,
'title' => 'Members',
),
'score' => NULL,
'index' => NULL,
'highlight' => NULL,
)
),
2 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 12,
'title' => 'Administrator users',
),
'score' => NULL,
'index' => NULL,
'highlight' => NULL,
)
),
3 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 13,
'title' => 'Editors',
),
'score' => NULL,
'index' => NULL,
'highlight' => NULL,
)
),
4 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 14,
'title' => 'Administrator User',
),
'score' => NULL,
'index' => NULL,
'highlight' => NULL,
)
),
5 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 42,
'title' => 'Anonymous Users',
),
'score' => NULL,
'index' => NULL,
'highlight' => NULL,
)
),
6 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 49,
'title' => 'Images',
),
'score' => NULL,
'index' => NULL,
'highlight' => NULL,
)
),
7 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 50,
'title' => 'Files',
),
'score' => NULL,
'index' => NULL,
'highlight' => NULL,
)
),
8 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 51,
'title' => 'Multimedia',
),
'score' => NULL,
'index' => NULL,
'highlight' => NULL,
)
),
9 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 52,
'title' => 'Common INI settings',
),
'score' => NULL,
'index' => NULL,
'highlight' => NULL,
)
),
10 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 54,
'title' => 'eZ Publish Demo Design (without demo content)',
),
'score' => NULL,
'index' => NULL,
'highlight' => NULL,
)
),
11 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 58,
'title' => 'Contact Us',
),
'score' => NULL,
'index' => NULL,
'highlight' => NULL,
)
),
12 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 59,
'title' => 'Partners',
),
'score' => NULL,
'index' => NULL,
'highlight' => NULL,
)
),
),
'spellSuggestion' => NULL,
'time' => 1,
'timedOut' => NULL,
'maxScore' => NULL,
'totalCount' => 13,
)
);

0 comments on commit d0afef4

Please sign in to comment.