Skip to content

Commit

Permalink
IndexerHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafael Kassner committed Aug 11, 2021
1 parent 6672d09 commit 34eaa36
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 34eaa36

Please # to comment.