Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smile elasticsuite has conflict with Amasty Quick Order for Magento 2 #2199

Closed
bojandavkov opened this issue Jul 7, 2021 · 11 comments
Closed
Assignees

Comments

@bojandavkov
Copy link

bojandavkov commented Jul 7, 2021

While using Amasty Quick Order i`m encountering this error. Is this know issue or something that can be fixed?

TypeError: Argument 1 passed to Smile\ElasticsuiteCore\Search\Adapter\Elasticsuite\Request\Mapper\Interceptor::buildSearchRequest() must be an instance of Smile\ElasticsuiteCore\Search\RequestInterface, instance of Magento\Framework\Search\Request given, called in /var/www/html/magento2/vendor/smile/elasticsuite/src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Adapter.php on line 104 and defined in /var/www/html/magento2/generated/code/Smile/ElasticsuiteCore/Search/Adapter/Elasticsuite/Request/Mapper/Interceptor.php:20 Stack trace: #0 /var/www/html/magento2/vendor/smile/elasticsuite/src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Adapter.php(104): Smile\ElasticsuiteCore\Search\Adapter\Elasticsuite\Request\Mapper\Interceptor->buildSearchRequest() #1 /var/www/html/magento2/vendor/smile/elasticsuite/src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Adapter.php(82): Smile\ElasticsuiteCore\Search\Adapter\Elasticsuite\Adapter->doSearch() #2 /var/www/html/magento2/vendor/magento/module-search/Model/SearchEngine.php(42): Smile\ElasticsuiteCore\Search\Adapter\Elasticsuite\Adapter->query() #3 /var/www/html/magento2/vendor/magento/framework/Search/Search.php(85): Magento\Search\Model\SearchEngine->search() #4 /var/www/html/magento2/vendor/amasty/module-quick-order/Model/Search.php(257): Magento\Framework\Search\Search->search() #5 /var/www/html/magento2/vendor/amasty/module-quick-order/Model/Search.php(228): Amasty\QuickOrder\Model\Search->searchProductIds() #6 /var/www/html/magento2/vendor/amasty/module-quick-order/Model/Search.php(182): Amasty\QuickOrder\Model\Search->getProductCollection() #7 /var/www/html/magento2/vendor/amasty/module-quick-order/Model/Search.php(165): Amasty\QuickOrder\Model\Search->generateSearchResult() #8 [internal function]: Amasty\QuickOrder\Model\Search->search() #9 /var/www/html/magento2/vendor/magento/module-webapi/Controller/Rest/SynchronousRequestProcessor.php(95): call_user_func_array() #10 /var/www/html/magento2/vendor/magento/module-webapi/Controller/Rest.php(188): Magento\Webapi\Controller\Rest\SynchronousRequestProcessor->process() #11 /var/www/html/magento2/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Webapi\Controller\Rest->dispatch() #12 /var/www/html/magento2/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Webapi\Controller\Rest\Interceptor->___callParent() #13 /var/www/html/magento2/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Webapi\Controller\Rest\Interceptor->Magento\Framework\Interception{closure}() #14 /var/www/html/magento2/generated/code/Magento/Webapi/Controller/Rest/Interceptor.php(23): Magento\Webapi\Controller\Rest\Interceptor->___callPlugins() #15 /var/www/html/magento2/vendor/magento/framework/App/Http.php(116): Magento\Webapi\Controller\Rest\Interceptor->dispatch() #16 /var/www/html/magento2/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\Http->launch() #17 /var/www/html/magento2/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\App\Http\Interceptor->___callParent() #18 /var/www/html/magento2/vendor/justbetter/magento2-sentry/Plugin/GlobalExceptionCatcher.php(43): Magento\Framework\App\Http\Interceptor->Magento\Framework\Interception{closure}() #19 /var/www/html/magento2/vendor/magento/framework/Interception/Interceptor.php(135): JustBetter\Sentry\Plugin\GlobalExceptionCatcher->aroundLaunch() #20 /var/www/html/magento2/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\Http\Interceptor->Magento\Framework\Interception{closure}() #21 /var/www/html/magento2/generated/code/Magento/Framework/App/Http/Interceptor.php(23): Magento\Framework\App\Http\Interceptor->___callPlugins() #22 /var/www/html/magento2/vendor/magento/framework/App/Bootstrap.php(263): Magento\Framework\App\Http\Interceptor->launch() #23 /var/www/html/magento2/index.php(39): Magento\Framework\App\Bootstrap->run() #24 {main}

Preconditions

Magento Version : 2.4.1

ElasticSuite Version : 2.10.x

Environment : Both

Third party modules :

Steps to reproduce

Screenshot from 2021-07-07 11-54-29

Expected result

Actual result

  1. [Screenshot, logs]
@ia-gaurav
Copy link

@bojandavkov please raise issue with Amasty

@bojandavkov
Copy link
Author

@bojandavkov please raise issue with Amasty

@ia-gaurav They have told me the opposite, to raise issue with Smile :)

@ia-gaurav
Copy link

@bojandavkov - as Amasty is paid module so you can ask them to provide compatibility issue in support.

@vahonc
Copy link
Collaborator

vahonc commented Jul 12, 2021

Hello @bojandavkov,

Did you try to disable the Amasty module? Did you notice your issue in this case?

Also could you please provide more details about what exactly you try to do and after what operations you got this error?

BR,
Vaym

@scottsb
Copy link
Contributor

scottsb commented Jul 20, 2021

Noting that we ran into this issue as well and also brought it up with Amasty support. This was their response:

I'm afraid that our development team has reviewed the compatibility you've mentioned and located an issue between our Quick Order extension and the third-party Smile ElasticSuite extension. They’ve tried to fix it, but it turned out a rather complicated item that requires major time investment and development. Unfortunately, due to that, the compatibility between the two extensions cannot be implemented

So basically the status quo is that these two modules cannot be used together. (In our case, we are invested in using ElasticSuite, so it's Amasty's module that will have to go by the wayside.)

@romainruaud
Copy link
Collaborator

I close the issue, according to community (we cannot see the sources of Amasty module since it's proprietary), there is an incompatibility between both modules.

I'm afraid you'll have to choose between us or them.

Regards

@pointia
Copy link

pointia commented Aug 9, 2021

@romainruaud the problem here is that an "api-like" search raises the error. What I mean is that the following Magento code (even though it uses the api) throws the error:

        $searchCriteria = $this->_fullTextSearchCriteriaFactory->create();

        /** To get list of available request names see Magento/CatalogSearch/etc/search_request.xml */
        $searchCriteria->setRequestName('quick_search_container');
        $filter = $this->_filterBuilder->setField('search_term')->setValue($query)->setConditionType('like')->create();
        $filterGroup = $this->_searchFilterGroupBuilder->addFilter($filter)->create();
        $currentPage = 1;
        $getPageLitmit = 5;
        $searchCriteria->setFilterGroups([$filterGroup])
            ->setCurrentPage($currentPage)
            ->setPageSize($getPageLitmit);
        $searchResults = $this->_fullTextSearchApi->search($searchCriteria);

I've added the following perference in a separate module and it started working

	<preference for="Magento\Framework\Api\Search\SearchInterface"
				type="Smile\ElasticsuiteCore\Model\Search" />

@vahonc
Copy link
Collaborator

vahonc commented Aug 9, 2021

Hello @pointia,

Thanks for your point of view, but if you believe that there are some bugs in the ES module you should create a new issue and add all the necessary details and explanations.

BR,
Vadym

@davidwindell
Copy link

We've just come across the same issue with Amasty Quick Order / Smile if anyone has any suggestions. Contacting Amasty now too.

@pvalium
Copy link

pvalium commented Feb 23, 2022

My solution was rewrite Amasty\QuickOrder\Model\Search with a preference, and remove ES search.
You can modify getProductCollection and search methods, in order to use mysql searches.
In my case, it was the quickest option.

@radub
Copy link

radub commented Aug 18, 2022

I have the same issue. @pvalium can you please provide an example with your fix? I'm also in a hurry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants