Skip to content

Commit

Permalink
Refix phpstan issues in spiral integration and add missing docs for r…
Browse files Browse the repository at this point in the history
…eindex opitons (#468)

as part of testing #467 we undo #466 to test CI here again.

Also update packages composer lock files.
Also update docs with reindex.
  • Loading branch information
alexander-schranz authored Dec 27, 2024
1 parent 6b55f82 commit 3a1b4ce
Show file tree
Hide file tree
Showing 25 changed files with 2,231 additions and 1,980 deletions.
617 changes: 397 additions & 220 deletions .examples/laravel/composer.lock

Large diffs are not rendered by default.

261 changes: 135 additions & 126 deletions .examples/mezzio/composer.lock

Large diffs are not rendered by default.

431 changes: 214 additions & 217 deletions .examples/spiral/composer.lock

Large diffs are not rendered by default.

258 changes: 128 additions & 130 deletions .examples/symfony/composer.lock

Large diffs are not rendered by default.

585 changes: 297 additions & 288 deletions .examples/yii/composer.lock

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion docs/getting-started/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1908,8 +1908,11 @@ First you need to create a ``ReindexProvider`` providing all your documents.
return 2;
}
public function provide(): \Generator
public function provide(ReindexConfig $reindexConfig): \Generator
{
// use `$reindexConfig->getIdentifiers()` or `$reindexConfig->getDateTimeBoundary()`
// to support partial reindexing
yield [
'id' => 1,
'title' => 'Title 1',
Expand Down
76 changes: 69 additions & 7 deletions docs/indexing/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,11 @@ the ``ReindexProviderInterface`` and provides the documents for your index.
return 3;
}
public function provide(): \Generator
public function provide(ReindexConfig $reindexConfig): \Generator
{
// use `$reindexConfig->getIdentifiers()` or `$reindexConfig->getDateTimeBoundary()`
// to support partial reindexing
yield [
'id' => 1,
'title' => 'Title 1',
Expand Down Expand Up @@ -110,10 +113,35 @@ After that you can use the ``reindex`` to index all documents:
];
// reindex all indexes
$reindexConfig = \CmsIg\Seal\Reindex\ReindexConfig::create();
$engine->reindex($reindexProviders);
// reindex specific index and drop data before
$engine->reindex($reindexProviders, 'blog', dropIndex: true);
$reindexConfig = \CmsIg\Seal\Reindex\ReindexConfig::create()
->withIndex('blog')
->withBulkSize(100)
->withDropIndex(true);
$engine->reindex($reindexProviders, $reindexConfig);
// reindex specific index since specific date
$reindexConfig = \CmsIg\Seal\Reindex\ReindexConfig::create()
->withIndex('blog')
->withBulkSize(100)
->withDropIndex(true)
->withDateTimeBoundary('-1 day');
$engine->reindex($reindexProviders, $reindexConfig);
// reindex specific identifiers
$reindexConfig = \CmsIg\Seal\Reindex\ReindexConfig::create()
->withIndex('blog')
->withBulkSize(100)
->withDropIndex(true)
->withIdentifiers([1, 2, 3]);
$engine->reindex($reindexProviders, $reindexConfig);
.. group-tab:: Laravel

Expand Down Expand Up @@ -146,7 +174,13 @@ After that you can use the ``reindex`` to index all documents:
php artisan cmsig:seal:reindex
# reindex specific index and drop data before
php artisan cmsig:seal:reindex --index=blog --drop
php artisan cmsig:seal:reindex --index=blog --drop --bulk-size=100
# reindex specific index since specific date
php artisan cmsig:seal:reindex --index=blog --drop --datetime-boundary="-1 day"
# reindex specific identifiers
php artisan cmsig:seal:reindex --index=blog --identifiers="1,2,3"
.. group-tab:: Symfony

Expand All @@ -169,7 +203,14 @@ After that you can use the ``reindex`` to index all documents:
# reindex all indexes
bin/console cmsig:seal:reindex
bin/console cmsig:seal:reindex --index=blog --drop
# reindex specific index and drop data before
bin/console cmsig:seal:reindex --index=blog --drop --bulk-size=100
# reindex specific index since specific date
bin/console artisan cmsig:seal:reindex --index=blog --drop --datetime-boundary="-1 day"
# reindex specific identifiers
bin/console artisan cmsig:seal:reindex --index=blog --identifiers="1,2,3"
.. group-tab:: Spiral

Expand All @@ -194,7 +235,14 @@ After that you can use the ``reindex`` to index all documents:
# reindex all indexes
php app.php cmsig:seal:reindex
php app.php cmsig:seal:reindex --index=blog --drop
# reindex specific index and drop data before
php app.php cmsig:seal:reindex --index=blog --drop --bulk-size=100
# reindex specific index since specific date
php app.php cmsig:seal:reindex --index=blog --drop --datetime-boundary="-1 day"
# reindex specific identifiers
php app.php cmsig:seal:reindex --index=blog --identifiers="1,2,3"
.. group-tab:: Mezzio

Expand Down Expand Up @@ -240,7 +288,14 @@ After that you can use the ``reindex`` to index all documents:
# reindex all indexes
vendor/bin/laminas cmsig:seal:reindex
vendor/bin/laminas cmsig:seal:reindex --index=blog --drop
# reindex specific index and drop data before
vendor/bin/laminas cmsig:seal:reindex --index=blog --drop --bulk-size=100
# reindex specific index since specific date
vendor/bin/laminas cmsig:seal:reindex --index=blog --drop --datetime-boundary="-1 day"
# reindex specific identifiers
vendor/bin/laminas cmsig:seal:reindex --index=blog --identifiers="1,2,3"
.. group-tab:: Yii

Expand Down Expand Up @@ -268,7 +323,14 @@ After that you can use the ``reindex`` to index all documents:
# reindex all indexes
./yii cmsig:seal:reindex
./yii cmsig:seal:reindex --index=blog --drop
# reindex specific index and drop data before
./yii cmsig:seal:reindex --index=blog --drop --bulk-size=100
# reindex specific index since specific date
./yii cmsig:seal:reindex --index=blog --drop --datetime-boundary="-1 day"
# reindex specific identifiers
./yii cmsig:seal:reindex --index=blog --identifiers="1,2,3"
Bulk operations
---------------
Expand Down
Loading

0 comments on commit 3a1b4ce

Please sign in to comment.