Skip to content

Commit

Permalink
Implement EZP-22564: LocationSearch powered by Solr search
Browse files Browse the repository at this point in the history
This is a combination of 32 commits:
EZP-22564: fixed docblock missing return hint

EZP-22564: schema: added fields necessary for block documents

EZP-22564: adapt gateway for block documents

EZP-22564: adapt handler for indexing Locations

EZP-22564: adapt criterion visitors for block documents

EZP-22564: implement and configure aggregate visitors for Location search

EZP-22564: implement Location search handler and gateway

EZP-22564: configure Location search for legacy_solr

EZP-22564: implement and configure criterion visitors

EZP-22564: implement and configure sort clause visitors

EZP-22564: temp: disable skipping Location search tests

EZP-22564: add missing test fixtures

EZP-22564: remove redundant fields from Content documents

EZP-22564: add SPI Document

EZP-22564: add regression suite to legacy_solr tests

EZP-22564: use SPI Document

EZP-22564: denormalize: Content name in main language

EZP-22564: implement ContentName sort clause

EZP-22564: denormalize: Section name and identifier

EZP-22564: implement SectionName and SectionIdentifier sort clauses

EZP-22564: denormalize: modification and publication dates

EZP-22564: implement DatePublished sort clause

EZP-22564: implement DateModified sort clause

EZP-22564: fixed: wrong class configured

EZP-22564: fixed: field name conflicts when using parent filter

EZP-22564: fixed condition

EZP-22564: add Content id to Trash signal

EZP-22564: implement CreateLocation Solr slot

EZP-22564: added second param Content id to deleteLocation()

EZP-22564: adapt gatway for indexing document blocks

EZP-22564: adapt handler for indexing document blocks

EZP-22564: Fix misc rebase issues
  • Loading branch information
pspanja authored and andrerom committed Dec 25, 2014
1 parent eff6847 commit 93b94a7
Show file tree
Hide file tree
Showing 77 changed files with 4,063 additions and 348 deletions.
34 changes: 23 additions & 11 deletions eZ/Publish/API/Repository/Tests/SearchServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1074,6 +1074,18 @@ function ( $a, $b )
),
$fixtureDir . 'SortDatePublished.php',
),
array(
array(
'filter' => new Criterion\SectionId( array( 2 ) ),
'offset' => 0,
'limit' => 10,
'sortClauses' => array(
new SortClause\DateModified(),
new SortClause\ContentId(),
)
),
$fixtureDir . 'SortDateModified.php',
),
array(
array(
'filter' => new Criterion\SectionId( array( 4, 2, 6, 3 ) ),
Expand Down Expand Up @@ -2008,7 +2020,7 @@ function ( SearchHit $searchHit )
public function testFindAndSortContentLegacy( $queryData, $fixture, $closure = null )
{
$setupFactory = $this->getSetupFactory();
if ( $setupFactory instanceof LegacySolr || $setupFactory instanceof LegacyElasticsearch )
if (/* $setupFactory instanceof LegacySolr ||*/ $setupFactory instanceof LegacyElasticsearch )
{
$this->markTestSkipped( "Location search handler is not yet implemented for Solr and Elasticsearch storage" );
}
Expand All @@ -2028,7 +2040,7 @@ public function testFindAndSortContentLegacy( $queryData, $fixture, $closure = n
public function testFindAndSortContentLocationsLegacy( $queryData, $fixture, $closure = null )
{
$setupFactory = $this->getSetupFactory();
if ( $setupFactory instanceof LegacySolr || $setupFactory instanceof LegacyElasticsearch )
if (/* $setupFactory instanceof LegacySolr ||*/ $setupFactory instanceof LegacyElasticsearch )
{
$this->markTestSkipped( "Location search handler is not yet implemented for Solr and Elasticsearch storage" );
}
Expand Down Expand Up @@ -3201,7 +3213,7 @@ public function testFindMainLocation()
$setupFactory = $this->getSetupFactory();
if ( $setupFactory instanceof LegacySolr )
{
$this->markTestSkipped( "Location search handler is not yet implemented for Solr storage" );
//$this->markTestSkipped( "Location search handler is not yet implemented for Solr storage" );
}

$plainSiteLocationId = 56;
Expand Down Expand Up @@ -3250,7 +3262,7 @@ public function testFindNonMainLocation()
$setupFactory = $this->getSetupFactory();
if ( $setupFactory instanceof LegacySolr )
{
$this->markTestSkipped( "Location search handler is not yet implemented for Solr storage" );
//$this->markTestSkipped( "Location search handler is not yet implemented for Solr storage" );
}

$designLocationId = 58;
Expand Down Expand Up @@ -3298,7 +3310,7 @@ public function testSortMainLocationAscending()
$setupFactory = $this->getSetupFactory();
if ( $setupFactory instanceof LegacySolr )
{
$this->markTestSkipped( "Location search handler is not yet implemented for Solr storage" );
//$this->markTestSkipped( "Location search handler is not yet implemented for Solr storage" );
}

$plainSiteLocationId = 56;
Expand Down Expand Up @@ -3345,7 +3357,7 @@ public function testSortMainLocationDescending()
$setupFactory = $this->getSetupFactory();
if ( $setupFactory instanceof LegacySolr )
{
$this->markTestSkipped( "Location search handler is not yet implemented for Solr storage" );
//$this->markTestSkipped( "Location search handler is not yet implemented for Solr storage" );
}

$plainSiteLocationId = 56;
Expand Down Expand Up @@ -3392,7 +3404,7 @@ public function testContentWithMultipleLocations()
$setupFactory = $this->getSetupFactory();
if ( $setupFactory instanceof LegacySolr )
{
$this->markTestSkipped( "Location search handler is not yet implemented for Solr storage" );
//$this->markTestSkipped( "Location search handler is not yet implemented for Solr storage" );
}

$repository = $this->getRepository();
Expand Down Expand Up @@ -3920,7 +3932,7 @@ public function testUserMetadataGroupHorizontalFilterLocation( $queryType = null
$setupFactory = $this->getSetupFactory();
if ( $setupFactory instanceof LegacySolr )
{
$this->markTestSkipped( "Location Search is not yet implemented for Solr storage" );
//$this->markTestSkipped( "Location Search is not yet implemented for Solr storage" );
}

if ( $queryType === null )
Expand Down Expand Up @@ -4019,7 +4031,7 @@ public function testUserMetadataGroupHorizontalQueryLocation()
$setupFactory = $this->getSetupFactory();
if ( $setupFactory instanceof LegacySolr )
{
$this->markTestSkipped( "Location Search is not yet implemented for Solr storage" );
//$this->markTestSkipped( "Location Search is not yet implemented for Solr storage" );
}

$this->testUserMetadataGroupHorizontalFilterLocation( "query" );
Expand Down Expand Up @@ -4223,7 +4235,7 @@ protected function assertQueryFixture( Query $query, $fixture, $closure = null )
$setupFactory = $this->getSetupFactory();
if ( $setupFactory instanceof LegacySolr )
{
$this->markTestSkipped( "Location search handler is not yet implemented for Solr storage" );
//$this->markTestSkipped( "Location search handler is not yet implemented for Solr storage" );
}

if ( $setupFactory instanceof LegacyElasticsearch )
Expand Down Expand Up @@ -4279,7 +4291,7 @@ protected function assertQueryFixture( Query $query, $fixture, $closure = null )
$fixture,
$result,
"Search results do not match.",
.1 // Be quite generous regarding delay -- most important for scores
.99 // Be quite generous regarding delay -- most important for scores
);
}

Expand Down
69 changes: 69 additions & 0 deletions eZ/Publish/API/Repository/Tests/_fixtures/Solr/Depth.php
Original file line number Diff line number Diff line change
@@ -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' => 1.9200476,
'index' => NULL,
'highlight' => NULL,
)
),
1 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 41,
'title' => 'Media',
),
'score' => 1.9200476,
'index' => NULL,
'highlight' => NULL,
)
),
2 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 45,
'title' => 'Setup',
),
'score' => 1.9200476,
'index' => NULL,
'highlight' => NULL,
)
),
3 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 56,
'title' => 'Design',
),
'score' => 1.9200476,
'index' => NULL,
'highlight' => NULL,
)
),
4 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 57,
'title' => 'Home',
),
'score' => 1.9200476,
'index' => NULL,
'highlight' => NULL,
)
),
),
'spellSuggestion' => NULL,
'time' => 1,
'timedOut' => NULL,
'maxScore' => 1.9200476,
'totalCount' => 5,
)
);
35 changes: 35 additions & 0 deletions eZ/Publish/API/Repository/Tests/_fixtures/Solr/DepthGt.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?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' => 1.9200476,
'index' => NULL,
'highlight' => NULL,
)),
1 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 14,
'title' => 'Administrator User',
),
'score' => 1.9200476,
'index' => NULL,
'highlight' => NULL,
)
),
),
'spellSuggestion' => NULL,
'time' => 1,
'timedOut' => NULL,
'maxScore' => 1.9200476,
'totalCount' => 2,
)
);
156 changes: 156 additions & 0 deletions eZ/Publish/API/Repository/Tests/_fixtures/Solr/DepthGte.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
<?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' => 1.9200476,
'index' => NULL,
'highlight' => NULL,
)
),
1 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 11,
'title' => 'Members',
),
'score' => 1.9200476,
'index' => NULL,
'highlight' => NULL,
)
),
2 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 12,
'title' => 'Administrator users',
),
'score' => 1.9200476,
'index' => NULL,
'highlight' => NULL,
)
),
3 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 13,
'title' => 'Editors',
),
'score' => 1.9200476,
'index' => NULL,
'highlight' => NULL,
)
),
4 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 14,
'title' => 'Administrator User',
),
'score' => 1.9200476,
'index' => NULL,
'highlight' => NULL,
)
),
5 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 42,
'title' => 'Anonymous Users',
),
'score' => 1.9200476,
'index' => NULL,
'highlight' => NULL,
)
),
6 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 49,
'title' => 'Images',
),
'score' => 1.9200476,
'index' => NULL,
'highlight' => NULL,
)),
7 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 50,
'title' => 'Files',
),
'score' => 1.9200476,
'index' => NULL,
'highlight' => NULL,
)
),
8 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 51,
'title' => 'Multimedia',
),
'score' => 1.9200476,
'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' => 1.9200476,
'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' => 1.9200476,
'index' => NULL,
'highlight' => NULL,
)
),
11 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 58,
'title' => 'Contact Us',
),
'score' => 1.9200476,
'index' => NULL,
'highlight' => NULL,
)
),
12 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 59,
'title' => 'Partners',
),
'score' => 1.9200476,
'index' => NULL,
'highlight' => NULL,
)
),
),
'spellSuggestion' => NULL,
'time' => 1,
'timedOut' => NULL,
'maxScore' => 1.9200476,
'totalCount' => 13,
)
);
Loading

0 comments on commit 93b94a7

Please sign in to comment.