Skip to content

Fulltext Collection modifies query, losing where clause #3466

Answered by rbayet
OvalMedia asked this question in Q&A
Discussion options

You must be logged in to vote

Addendum for @OvalMedia, I scrolled up and saw indeed that the third party module is adding a SQL condition through addAttributeToFilter which the Elasticsuite product collection does not override.

It if where me, I would simply use the product collection to do a search on the sku, but if you want to stick to the approach of that module, you could simply replace

$result->distinct(true)->addAttributeToFilter('entity_id', ['in' => $this->helperData->getIdsBySku($sku)]);

by

 $result->addFieldToFilter('entity_id', ['in' => $this->helperData->getIdsBySku($sku)]);

Regards,

Replies: 5 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@OvalMedia
Comment options

Answer selected by OvalMedia
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
3 participants
Converted from issue

This discussion was converted from issue #3465 on December 10, 2024 16:01.