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

Elastic search not working if sku is like 42-315 #20689

Closed
arijit-codilar opened this issue Jan 28, 2019 · 44 comments
Closed

Elastic search not working if sku is like 42-315 #20689

arijit-codilar opened this issue Jan 28, 2019 · 44 comments
Assignees
Labels
Component: Elasticsearch Fixed in 2.4.x The issue has been fixed in 2.4-develop branch help wanted Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Priority: P3 May be fixed according to the position in the backlog. Progress: done Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Severity: S2 Major restrictions or short-term circumventions are required until a fix is available. stale issue

Comments

@arijit-codilar
Copy link

Preconditions (*)

  1. Magento 2.3 OpenSource
  2. PHP 7.1
  3. Apache
  4. MySql 14.14
  5. Ubuntu 18.04 LTS

Steps to reproduce (*)

  1. Create 2 or 3 products with sku like 42-315, 42-317 and 42-318.
  2. Enable the elasticsearch in configuration and server.
  3. Search in the frontend with sku 42-315.

Expected result (*)

  1. Only product with sku 42-315 should come.

Actual result (*)

  1. Unmatched products are also coming along with matched sku 42-315.
  2. iPhone has sku 42-315.
    imagea
@magento-engcom-team
Copy link
Contributor

Hi @arijit-codilar. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento-engcom-team give me $VERSION instance

where $VERSION is version tags (starting from 2.2.0+) or develop branches (for example: 2.3-develop).
For more details, please, review the Magento Contributor Assistant documentation.

@arijit-codilar do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Jan 28, 2019
@LuciferStrome LuciferStrome self-assigned this Jan 28, 2019
@magento-engcom-team
Copy link
Contributor

Hi @LuciferStrome. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • 6. Add label Issue: Confirmed once verification is complete.

  • 7. Make sure that automatic system confirms that report has been added to the backlog.

@ghost ghost self-assigned this Jan 28, 2019
@magento-engcom-team
Copy link
Contributor

Hi @engcom-backlog-nazar. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • 6. Add label Issue: Confirmed once verification is complete.

  • 7. Make sure that automatic system confirms that report has been added to the backlog.

@ghost ghost added Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Component: Elasticsearch Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release help wanted and removed Component: Elasticsearch labels Jan 28, 2019
@ghost
Copy link

ghost commented Jan 28, 2019

HI @ arijit-codilar thank you for your report, just for note, if you use Mysql search engine and type on search "42-" the exception is become.
selection_295

@arijit-codilar
Copy link
Author

arijit-codilar commented Jan 28, 2019

@engcom-backlog-nazar I am getting the below result when I am searching with 42- using MySql which is again I believe an issue because it should return the products matching that query text.

imageb

@ghost
Copy link

ghost commented Jan 28, 2019

@arijit-codilar hmm.. strange i'm getting exception on clean 2.3-dev instance

@arijit-codilar
Copy link
Author

@engcom-backlog-nazar I have installed the Magento from magento's site but still it should not get into two directions.

@ghost ghost added Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Jan 28, 2019
@magento-engcom-team magento-engcom-team added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Jan 28, 2019
@magento-engcom-team
Copy link
Contributor

@engcom-backlog-nazar Thank you for verifying the issue. Based on the provided information internal tickets MAGETWO-97943, MAGETWO-97944 were created

@ghost
Copy link

ghost commented Jan 28, 2019

@magento-engcom-team give me 2.3-develop instance

@magento-engcom-team
Copy link
Contributor

Hi @engcom-backlog-nazar. Thank you for your request. I'm working on Magento 2.3-develop instance for you

@ghost ghost removed their assignment Jan 28, 2019
@LuciferStrome LuciferStrome removed their assignment Jan 28, 2019
@amol2jcommerce
Copy link
Contributor

@magento-engcom-team give me 2.3-develop instance

@magento-engcom-team
Copy link
Contributor

Hi @amol2jcommerce. Thank you for your request. I'm working on Magento 2.3-develop instance for you

@magento-engcom-team
Copy link
Contributor

Hi @amol2jcommerce, here is your Magento instance.
Admin access: https://i-20689-2-3-develop.instances.magento-community.engineering/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

@ghost
Copy link

ghost commented Jan 28, 2019

@arijit-codilar on vanilla
selection_296

@arijit-codilar
Copy link
Author

@engcom-backlog-nazar But I am getting something different which I have shared above. And, my instance has been downloaded from magento's site.

Are you using Elastic search or MySql?

@ghost
Copy link

ghost commented Jan 28, 2019

@arijit-codilar no this only appears on Mysql, but perfectly works with Elastic

@denchev
Copy link
Contributor

denchev commented Dec 7, 2020

@magento give me 2.4-develop instance

@magento-deployment-service
Copy link

Hi @denchev. Thank you for your request. I'm working on Magento instance for you.

@magento-deployment-service
Copy link

@denchev
Copy link
Contributor

denchev commented Dec 7, 2020

This behavior continues to appear in 2.4 Not quite sure if this is a bug but I will spend some time to investigate a bit deeper.

I created 3 products with the mentioned skus 42-315, 42-317 and 42-318. When I search for the first one 42-315 I got all the 3 products + 3 more than have SKUs like 24-WG080, 24-WG088 and 24-WG084. Since 24 is the reverse of 42 and there is a dash in the SKU I assume that Elasticsearch is doing some "magic" when storing the results.

I will try to see if there are any settings that can be tweaked.

@magento I am working on this

@denchev
Copy link
Contributor

denchev commented Dec 22, 2020

I've been investigating this and it looks like the problem is with Elasticsearch tokenizer. I would not count this is a bug per-say as this is how Elasticsearch is supposed to work. I found this to be a merchant-facing issue as I had clients that complain about this same behavior. I am working on a potential solution - a non-core module (for now) that will allow merchants to turn on/off tokenization for certain attributes (sku). This should fix this type of issue. I don't think this is something that belongs to Magento 2 core code. As soon as I have it I will post it here and maybe then a discussion can start on what to do with the whole problem in general.

@stale
Copy link

stale bot commented May 6, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 14 days if no further activity occurs. Is this issue still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? Thank you for your contributions!

@magento-engcom-team
Copy link
Contributor

Hi @arijit-codilar, @denchev.

Thank you for your report and collaboration!

The related internal Jira ticket MC-24438 was closed as Fixed.

The fix will be available with the upcoming 2.4.3 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Elasticsearch Fixed in 2.4.x The issue has been fixed in 2.4-develop branch help wanted Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Priority: P3 May be fixed according to the position in the backlog. Progress: done Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Severity: S2 Major restrictions or short-term circumventions are required until a fix is available. stale issue
Projects
None yet
Development

No branches or pull requests