Skip to content

Commit

Permalink
Merge branch 'release/3.3.3-beta.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
janhenckens committed Feb 13, 2024
2 parents f60e5d5 + d385f09 commit 1a1248d
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 17 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to this project will be documented in this file.

## 3.3.3-beta.2 - 2024-02-13
### Fixed
- Fixed missing deletion of orphans of split elements ([#259](https://github.com/studioespresso/craft-scout/issues/259))

## 3.3.3-beta.1 - 2023-12-06
### Fixed
- This beta release is a first try at resolving an issue with deindexing of element not working properly. ([#281](https://github.com/studioespresso/craft-scout/issues/281))
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@ You can use this to define index settings that get synced when you call the `./c
This way you can keep your index settings in source control.
The IndexSettings object provides autocompletion for all Algolia's settings

> [!NOTE]
> Note that settings are not synced automatically, but only when the `./craft scout/settings/update` console command is run.
```php
->indexSettings(
\rias\scout\IndexSettings::create()
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "studioespresso/craft-scout",
"description": "Craft Scout provides a simple solution for adding full-text search to your entries. Scout will automatically keep your search indexes in sync with your entries.",
"type": "craft-plugin",
"version": "3.3.3-beta.1",
"version": "3.3.3-beta.2",
"keywords": [
"craft",
"cms",
Expand Down
15 changes: 6 additions & 9 deletions src/engines/Engine.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,13 @@ public function splitObjects(array $objects): array
$objectToSave['distinctID'] = $objectToSave['objectID'];
$objectsToSave[] = $objectToSave;
}

continue;
}

foreach ($splittedObjects as $part => $splittedObject) {
$splittedObject['distinctID'] = $splittedObject['objectID'];
$splittedObject['objectID'] = "{$splittedObject['objectID']}_{$part}";
$objectsToSave[] = $splittedObject;
} else {
foreach ($splittedObjects as $part => $splittedObject) {
$splittedObject['distinctID'] = $splittedObject['objectID'];
$splittedObject['objectID'] = "{$splittedObject['objectID']}_{$part}";
$objectsToSave[] = $splittedObject;
}
}

$objectsToDelete[] = $object;
}

Expand Down
10 changes: 5 additions & 5 deletions tests/_craft/config/db.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

return [
'server' => getenv('DB_SERVER') ?? '127.0.0.1',
'user' => getenv('DB_USER') ?? 'root',
'password' => getenv('DB_PASSWORD') ?? 'root',
'database' => getenv('DB_DATABASE') ?? 'scout_testing',
'server' => '127.0.0.1',
'user' => 'root',
'password' => 'root',
'database' => 'scout_testing',
'schema' => getenv('DB_SCHEMA'),
'tablePrefix' => '',
'driver' => 'mysql',
'port' => getenv('DB_PORT') ?? 3306,
'port' => 3306,
];
14 changes: 14 additions & 0 deletions tests/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: "2"
services:
mysql:
restart: always
image: mysql/mysql-server:5.7
environment:
MYSQL_ROOT_PASSWORD: "root_password"
MYSQL_DATABASE: "scout_testing"
MYSQL_USER: "root"
MYSQL_PASSWORD: "root"
MYSQL_ROOT_HOST: "0.0.0.0"
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
ports:
- "3306:3306"
4 changes: 2 additions & 2 deletions tests/unit/ScoutIndexTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,14 @@ public function it_throws_an_exception_if_no_query_is_returned_from_criteria()
}

/** @test * */
public function it_sets_the_primary_site_id_if_the_criteria_has_no_site_id()
public function it_checks_any_site_if_the_criteria_has_no_site_id()
{
$index = new ScoutIndex('Blog');

$index->criteria(function($query) {
return $query;
});

$this->assertEquals(Craft::$app->getSites()->getPrimarySite()->id, $index->criteria->siteId);
$this->assertEquals('*', $index->criteria->siteId);
}
}

0 comments on commit 1a1248d

Please sign in to comment.