Skip to content

Commit 7968ab9

Browse files
committed
Add fake elasticsearch checker
1 parent 2aa66bd commit 7968ab9

File tree

4 files changed

+35
-0
lines changed

4 files changed

+35
-0
lines changed

UPGRADE-2.0.md

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- New method `deleteByDocumentIds` in the `MonsieurBiz\SyliusSearchPlugin\Index\IndexerInterface` interface
1212
- Deprecated the method `deleteByDocuments` in the `MonsieurBiz\SyliusSearchPlugin\Index\IndexerInterface` interface. Use `deleteByDocumentIds` instead.
1313
- `ChannelFilter` and `EnabledFilter` in `MonsieurBiz\SyliusSearchPlugin\Search\Request\QueryFilter\Product` were moved to `MonsieurBiz\SyliusSearchPlugin\Search\Request\QueryFilter`
14+
- 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)
1415

1516
# UPGRADE FROM v1.X.X TO v2.0.x
1617

docs/disable_elasticsearch_checker.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Disable the ElasticsearchChecker
2+
3+
The plugin now checks if the Elasticsearch server is running before each search.
4+
5+
If you want to disable this feature, you can do it by adding the following configuration:
6+
7+
```yaml
8+
services:
9+
monsieurbiz.search.checker.elasticsearch_checker:
10+
class: MonsieurBiz\SyliusSearchPlugin\Checker\FakeElasticsearchChecker
11+
```

docs/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Menu
44

5+
- [Disable the ElasticsearchChecker](./disable_elasticsearch_checker.md)
56
- [Add custom sorts](./add_custom_sorts.md)
67
- [Add custom values for an entity](./add_custom_values.md)
78
- [Add custom filters](./add_custom_filters.md)
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
/*
4+
* This file is part of Monsieur Biz' Search plugin for Sylius.
5+
*
6+
* (c) Monsieur Biz <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE.txt
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace MonsieurBiz\SyliusSearchPlugin\Checker;
15+
16+
class FakeElasticsearchChecker implements ElasticsearchCheckerInterface
17+
{
18+
public function check(): bool
19+
{
20+
return true;
21+
}
22+
}

0 commit comments

Comments
 (0)