elasticsuite
elasticsuite copied to clipboard
The product searched by SKU is shown last in the list
Magento 2.4.2 smile/elasticsuite 2.10.9 Magento 2 merchandising and search engine built on ElasticSearch
If I search in the search bar a product by SKU it is shown the first one in the dropdown list. In the search page with the results the products are shown the other way. Enclosed you can see print screens with the 2 situations.
How can I set the correct order in search result page?
Hello @OvidiuCalugar
First of all, provide information about your environment (version of Magento, ElasticSuite, third-party extension, etc)
BR, Vadym
Sorry about that. It's Magento 2.4.2 Smile-SA elasticsuite
@OvidiuCalugar, thanks for the Magento version, but regarding ElasticSuite, the "Smile-SA elasticsuite" you specified is not enough for us, we need to specify the exact version, for example 2.10.11 (currently the latest version).
You can get this from the output of this command:
$ composer info | grep elasticsuite
BR, Vadym
Hello @OvidiuCalugar,
While waiting for your answer to @vahonc's question, have you changed any settings in admin under "Elasticsuite > Search Engine > Search Relevance" ? What is the search weight of the "sku" attribute ?
You could have different results also if you created an Optimizer but only made it applied to "Catalog Product Autocomplete" requests and not both "Catalog Product Autocomplete" and "Catalog Product Search".
Regards,
Hi, I just received the elastic suite versions. I updated the post. Regarding your questions: Relevance Configuration
- Fulltext base setting: 100% with Tie Breaker 1
- Enable boost on Phrase match is set to yes
- Phrase Match Boost Value is 10
- Cutoff Frequency is 0.15 Spellchecking Configuration:
- Fuzziness is enabled with Automatic value, 1 for Prefix Lenght and 10 for Max expansion
- Phonetic search is enabled Thesaurus Configuration
- Max allowed rewrites is 2
- synonims search is enabled with 10 weight divider
- query Search Expansions is enabled with Concepts weight divider 10
Search weight for SKU I set to 6. Name has search weight 2 and all other attributes have search weight 1.
There is an Optimizer that sends my out of stock products to the end of the category page. (In stock products have a 99 Boost value) At Request type are set all 3 options: Catalog Product Search, Catalog Product Autocomplete and Category Product View
Hello @OvidiuCalugar,
The update for the version of the ElasticSuite that you specified is again not correct.
I assume that you are using 2.10.x version (or 2.9.x, which is unlikely). I have given you clear instructions on how to easily find out exactly which version you are using. So just run the below command in your environment:
$ composer info | grep elasticsuite
You should get the next output:
smile/elasticsuite 2.10.11 Magento 2 merchandising and search engine built on ElasticSearch
Perhaps you do not have the ability or access to the command line?
BR, Vadym
Hi. I don't have the ability to access the command line but I received form my colleagues the answer :) The version is: smile/elasticsuite 2.10.9 Magento 2 merchandising and search engine built on ElasticSearch
Hello @OvidiuCalugar,
Thanks for your clarifications. We will try to check the changelog of this version.
Have you tried to check the behavior of product search by SKU and your Optimizer on the default Magento theme (Luma)? Maybe your theme has some specific settings for search results sorting or smth like that.
BR, Vadym
Hello @vahonc,
I didn't try on Luma. I don't have an instance only with Luma but I have a staging version of the website with full settings. I deactivated now the optimizer on staging and I tried to search but the result is the same like on live with optimizer on. I will ask my colleagues if we have can create an instance with Luma and the optimizer.
@OvidiuCalugar,
I tried to reproduce your issue according to your conditions on my test environment, but without success. I got the results that I expected.
For this I use:
- M2.4.2-p1 EE with default sample data + Luma theme
- ElasticSuite 2.10.9
Below you can find my detailed explanation with screenshots.
Firstly, I created three test products with similar SKUs like 25-MG0x.
As you can see one of them, namely Dash Digital Watch II (SKU: 25-MG02) is Out of Stock
Then I created an Optimizer for moving Out of Stock products to the end of the list.
And now, if we go to the Gear
=> Watches
category we will see at the end of the products listing there are two products that are Out of Stock (Dash Digital Watch II and Luma Analog Watch). The latest doesn't belong to this issue ;-)
Finally, I tried to search these products by SKU mask.
Autocomplete results:
Search results:
As you can see the result is the same in both cases, and the Out of Stock product, namely Dash Digital Watch II (SKU: 25-MG02) is displayed at the end of the list because my Optimizer is working. And if I update the Boost value (%)
from -99
to 99
in the configuration of my optimizer I moving Out of stock products at the top of the list in both cases (as for autocomplete suggestions and as for search results).
Therefore I believe that your issue is linked to your custom theme. If it's so, there is not much we can do for your issue, because compatibility with third-party modules or themes is out of the scope of our Open Source support policy provided here.
BR, Vadym
Thank you @vahonc for the time and for the detailed explanation. We will do more tests on the staging version to find out the compatibility problem.
This issue was waiting update from the author for too long. Without any update, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. Please don't hesitate to comment on the bug if you have any more information for us; we will reopen it right away! Thanks for your contribution.
Hi.
I found the problem.
Is a conflict between ElasticSuite and Improved Sorting from Amasty.
If I choose Yes at Show Out of Stock
Products Last in Improved Sorting then the search after SKU is correct.
It was set to No beacause the option didn't work on my website and that is why we made the Optimizer that shows my out of stock products in last positions on the category page,
We will update the Improved Sorting extension to see if the problem is solved and I will get back to you with an answer.
no need to update to the last version of the extension. So if you have Elastic suite and Improved sorting from Amasty and you have the problem above just set YES at Show Out of Stock Products Last in Improved Sorting, reset the manual positioning in Category (i you have) and at the Recomended selection product view on category page the out of stock products will be shown last and the Search by SKU will work correctly.
@OvidiuCalugar,
Can we consider your problem solved and close this ticket?
BR, Vadym
Yes. Thank you!