public function afterSave(
        \Magento\Catalog\Api\Data\ProductAttributeInterface $subject,
        \Magento\Catalog\Api\Data\ProductAttributeInterface $result
    ) {
        $cleanCache = false;

        if ($subject->dataHasChangedFor('search_weight')) {
            $cleanCache = true;
        }

        if ($cleanCache) {
            $this->indicesConfig->reset();
        }

        return $result;
    }
public function afterSave(
        \Magento\Catalog\Api\Data\ProductAttributeInterface $subject,
        \Magento\Catalog\Api\Data\ProductAttributeInterface $result
    ) {
        $cleanCache = false;

        if ($subject->dataHasChangedFor('search_weight')) {
            $cleanCache = true;
        }

        if ($cleanCache) {
            $this->indicesConfig->reset();
        }

        return $result;
    }
public function afterSave ( \ Magento \ Catalog \ Api \ Data \ ProductAttributeInterface $ subject , \ Magento \ Catalog \ Api \ Data \ ProductAttributeInterface $ result ) { $ cleanCache = false ; if ( $ subject -> dataHasChangedFor ( 'search_weight' ) ) { $ cleanCache = true ; } if ( $ cleanCache ) { $ this -> indicesConfig -> reset ( ) ; } return $ result ; }
Invalidate indices config after attribute is modified.

@param \Magento\Catalog\Api\Data\ProductAttributeInterface $subject The attribute being saved
@param \Magento\Catalog\Api\Data\ProductAttributeInterface $result  The attribute being saved

@return \Magento\Catalog\Api\Data\ProductAttributeInterface
Invalidate indices config after attribute is modified .