Question

I am using Sphinx Search Extension. it was working good on Magento 2.2.8 version. Now am upgrade my store on 2.3.2 it give error

Undefined factory sphinx

Anyone also face this issue? if then how to resolve it?

No correct solution

OTHER TIPS

I don't know how sphinx works, but your search engine requires a factory attached to the Magento\CatalogSearch\Model\Search\ItemCollectionProvider class.
You can do this via di.xml of one of your modules (probably the sphinx module itself)

<type name="Magento\CatalogSearch\Model\Search\ItemCollectionProvider">
    <arguments>
        <argument name="factories" xsi:type="array">
            <item name="sphinx" xsi:type="object">class name or virtual type name here</item>
        </argument>
    </arguments>
</type>

Here is an example on how it works for elasticsearch6. vendor/magento/module-elasticsearch-6/etc/di.xml

<type name="Magento\CatalogSearch\Model\Search\ItemCollectionProvider">
    <arguments>
        <argument name="factories" xsi:type="array">
            <item name="elasticsearch6" xsi:type="object">elasticsearchAdvancedCollectionFactory</item>
        </argument>
    </arguments>
</type>

where elasticsearchAdvancedCollectionFactory is a virtual type defined in vendor/magento/module-elasticsearch/etc/di.xml

 <virtualType name="elasticsearchAdvancedCollectionFactory" type="Magento\CatalogSearch\Model\ResourceModel\Advanced\CollectionFactory">
    <arguments>
        <argument name="instanceName" xsi:type="string">elasticsearchAdvancedCollection</argument>
    </arguments>
</virtualType>

where elasticsearchAdvancedCollection is another virtual type. you can search for it further in di.xml files.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top