|
@@ 4407-4415 (lines=9) @@
|
| 4404 |
|
|
| 4405 |
|
// Legacy search engine does have scoring, sorting the results by ID in that case |
| 4406 |
|
$setupFactory = $this->getSetupFactory(); |
| 4407 |
|
if (get_class($setupFactory) === 'eZ\Publish\API\Repository\Tests\SetupFactory\Legacy') { |
| 4408 |
|
$this->sortSearchHitsById($searchHits); |
| 4409 |
|
|
| 4410 |
|
$this->assertEquals($content1->id, $searchHits[0]->valueObject->id); |
| 4411 |
|
$this->assertEquals($content2->id, $searchHits[1]->valueObject->id); |
| 4412 |
|
$this->assertEquals($content3->id, $searchHits[2]->valueObject->id); |
| 4413 |
|
|
| 4414 |
|
return; |
| 4415 |
|
} |
| 4416 |
|
|
| 4417 |
|
// Assert scores are descending |
| 4418 |
|
$this->assertGreaterThan($searchHits[1]->score, $searchHits[0]->score); |
|
@@ 4479-4487 (lines=9) @@
|
| 4476 |
|
|
| 4477 |
|
// Legacy search engine does have scoring, sorting the results by ID in that case |
| 4478 |
|
$setupFactory = $this->getSetupFactory(); |
| 4479 |
|
if (get_class($setupFactory) === 'eZ\Publish\API\Repository\Tests\SetupFactory\Legacy') { |
| 4480 |
|
$this->sortSearchHitsById($searchHits); |
| 4481 |
|
|
| 4482 |
|
$this->assertEquals($content1->id, $searchHits[0]->valueObject->contentId); |
| 4483 |
|
$this->assertEquals($content2->id, $searchHits[1]->valueObject->contentId); |
| 4484 |
|
$this->assertEquals($content3->id, $searchHits[2]->valueObject->contentId); |
| 4485 |
|
|
| 4486 |
|
return; |
| 4487 |
|
} |
| 4488 |
|
|
| 4489 |
|
// Assert scores are descending |
| 4490 |
|
$this->assertGreaterThan($searchHits[1]->score, $searchHits[0]->score); |