Skip to content

Commit

Permalink
Merge pull request #3 from kassner/patch-1
Browse files Browse the repository at this point in the history
IndexerHandler
  • Loading branch information
Benjamin Calef authored Aug 12, 2021
2 parents 6672d09 + 34eaa36 commit 016f374
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
32 changes: 32 additions & 0 deletions Model/Indexer/IndexerHandler.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

declare(strict_types=1);

/**
* Copyright © Zepgram, Inc. All rights reserved.
*/

namespace Zepgram\DisableSearchEngine\Model\Indexer;

class IndexerHandler implements \Magento\Framework\Indexer\SaveHandler\IndexerInterface
{
public function saveIndex($dimensions, \Traversable $documents)
{
return $this;
}

public function deleteIndex($dimensions, \Traversable $documents)
{
return $this;
}

public function cleanIndex($dimensions)
{
return $this;
}

public function isAvailable($dimensions = [])
{
return true;
}
}
7 changes: 7 additions & 0 deletions etc/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,11 @@
</argument>
</arguments>
</type>
<type name="Magento\CatalogSearch\Model\Indexer\IndexerHandlerFactory">
<arguments>
<argument name="handlers" xsi:type="array">
<item name="none" xsi:type="string">Zepgram\DisableSearchEngine\Model\Indexer\IndexerHandler</item>
</argument>
</arguments>
</type>
</config>

0 comments on commit 016f374

Please # to comment.