I am trying to inject my custom object in constructor like this in di.xml
<type name="Magento\CatalogSearch\Block\Advanced\Result">
<arguments>
<argument name="data" xsi:type="array">
<item name="catalogFilterHelper" xsi:type="string">Package\Module\Helper\Data</item>
</argument>
</arguments>
</type>
<type name="Magento\CatalogSearch\Block\Result">
<arguments>
<argument name="data" xsi:type="array">
<item name="catalogFilterHelper" xsi:type="object">Package\Module\Helper\Data</item>
</argument>
</arguments>
</type>
And trying to access it in theme template like
app/design/frontend/Vendor/theme/Magento_CatalogSearch/templates/advanced/result.phtml
$block->getData('catalogFilterHelper');
It returns null.
When I am trying to get the object in the same template by using object manager.
//$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
//$block = $objectManager->get(\Magento\CatalogSearch\Block\Advanced\Result::class);
I get the proper result.
So seems like when layout is executed and blocks are created it overides the di.xml configurations for blocks $data array.