Smile-SA / elasticsuite

Smile ElasticSuite - Magento 2 merchandising and search engine built on ElasticSearch
https://elasticsuite.io
Open Software License 3.0
760 stars 336 forks source link

Product Search Issue: Incomplete Results for Partial Product Name or SKU in Elasticsuite #3278

Open adriyanj0 opened 1 month ago

adriyanj0 commented 1 month ago

We are having trouble with the product search on our Magento 2 site using the Elasticsuite module. When customers type part of a product name or SKU, the search results are incomplete or missing. For example, typing "46" only shows products with "46" exactly in the SKU or title. It does not show products containing "146," "1046," or "460."

Steps to Reproduce:

  1. Go to the search bar on our Magento 2 site.
  2. Type part of a product name or SKU (e.g., "46").
  3. Check the search results.

Expected Behavior: The search should show all products that include the typed part, such as "146," "1046," and "460."

Actual Behavior: Only products with the exact match "46" are shown. Sometimes, no results are displayed even when typing the full product name or SKU.

Request for Help: We need help to configure Elasticsuite so it shows better search results. Specifically:

Settings or adjustments to improve partial match results.

  1. Key parameters in Elasticsuite to check.
  2. Best practices for optimizing search results.
  3. Thank you for your assistance.

Environment: Magento 2 version: 2.4.6-p4 ElasticSuite Open Source version.

vahonc commented 1 month ago

Hello @adriyanj0,

Which version of Elasticsuite you are using?

BR, Vadym

adriyanj0 commented 1 month ago

Hello @adriyanj0,

Which version of Elasticsuite you are using?

BR, Vadym

Hello,

We`re using ElasticSuite Open Source version.

BR,

vahonc commented 1 month ago

@adriyanj0,

That's not what I wanted to hear. I need detailed information. In the Magento BO in the lower right corner (in the footer), you should see something like this:

Adobe Commerce ver. 2.4.6 ElasticSuite Open Source ver. 2.11.0

BR, Vadym

adriyanj0 commented 1 month ago

@vahonc

The version that we use is ElasticSuite Open Source ver. 2.11.4.1. My bad

@adriyanj0,

That's not what I wanted to hear. I need detailed information. In the Magento BO in the lower right corner (in the footer), you should see something like this:

Adobe Commerce ver. 2.4.6 ElasticSuite Open Source ver. 2.11.0

BR, Vadym

vahonc commented 1 month ago

@adriyanj0, sorry for the late response

Unfortunately, what you want to do cannot be done out of the box, in other words, there is no easy way to implement such behavior.

You might solve some of your cases by activating the settings we added in a couple previous releases. If on your version of Elasticsuite you don't find these settings please update/reinstall our module.

Stores > Configuration > Elasticsuite > Analyzers Settings > Remove leading zeroes of numeric parts / Remove trailing zeroes of numeric parts

Screenshot from 2024-05-23 18-05-52

Screenshot from 2024-05-23 17-37-44

Elasticsuite > Search Relevance > Spellchecking Configuration > Term Vectors Configuration > [Experimental] Use reference analyzer in term vectors

Screenshot from 2024-05-23 17-41-12

But then I'm not 100% sure you will be able to match 146 from 46 since in the reference analyzer we do not split contiguous tokens (series of pure digits or letters) while we do split alphanumerical ones 146AB37-D5 => 146 AB 37 D 5 Yes, the fuzziness could go from 46 to 146 but the fuzziness prefix will prevent modifying the first letter, so I don't see that happening. If you really need that behavior, you could try to change the analyzer of the SKU attribute from "reference" to "standard_edge_ngram"

Screenshot from 2024-05-23 17-43-34

But again, I'm not even sure it will allow matching 146 from 46 since "146" will be indexed at best as "14, 146".

BR, Vadym