diff --git a/UPGRADE-2.0.md b/UPGRADE-2.0.md index a55e3154..52473d44 100644 --- a/UPGRADE-2.0.md +++ b/UPGRADE-2.0.md @@ -11,6 +11,7 @@ - New method `deleteByDocumentIds` in the `MonsieurBiz\SyliusSearchPlugin\Index\IndexerInterface` interface - Deprecated the method `deleteByDocuments` in the `MonsieurBiz\SyliusSearchPlugin\Index\IndexerInterface` interface. Use `deleteByDocumentIds` instead. - `ChannelFilter` and `EnabledFilter` in `MonsieurBiz\SyliusSearchPlugin\Search\Request\QueryFilter\Product` were moved to `MonsieurBiz\SyliusSearchPlugin\Search\Request\QueryFilter` +- A fallback on the Sylius' taxon display is now used to keep your pages even if you Elasticsearch instance is down. If you want to disable it, check the [FakeElasticsearchChecker](docs/disable_elasticsearch_checker.md) # UPGRADE FROM v1.X.X TO v2.0.x diff --git a/docs/disable_elasticsearch_checker.md b/docs/disable_elasticsearch_checker.md new file mode 100644 index 00000000..50cef848 --- /dev/null +++ b/docs/disable_elasticsearch_checker.md @@ -0,0 +1,11 @@ +# Disable the ElasticsearchChecker + +The plugin now checks if the Elasticsearch server is running before each search. + +If you want to disable this feature, you can do it by adding the following configuration: + +```yaml +services: + monsieurbiz.search.checker.elasticsearch_checker: + class: MonsieurBiz\SyliusSearchPlugin\Checker\FakeElasticsearchChecker +``` diff --git a/docs/index.md b/docs/index.md index 1e19a1e7..57205f04 100644 --- a/docs/index.md +++ b/docs/index.md @@ -2,6 +2,7 @@ ## Menu +- [Disable the ElasticsearchChecker](./disable_elasticsearch_checker.md) - [Add custom sorts](./add_custom_sorts.md) - [Add custom values for an entity](./add_custom_values.md) - [Add custom filters](./add_custom_filters.md) diff --git a/src/Checker/FakeElasticsearchChecker.php b/src/Checker/FakeElasticsearchChecker.php new file mode 100644 index 00000000..0febc406 --- /dev/null +++ b/src/Checker/FakeElasticsearchChecker.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace MonsieurBiz\SyliusSearchPlugin\Checker; + +class FakeElasticsearchChecker implements ElasticsearchCheckerInterface +{ + public function check(): bool + { + return true; + } +}