-
Notifications
You must be signed in to change notification settings - Fork 340
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
SKU not searched in the autocomplete separately #829
Comments
Hello, first of all, thank you for your congratulations and for using our module, you're welcome. And from what I can see, you understood well how you are able to extend index properties via the XML file, which is fine. A question here, did you find it on the developer documentation (on our wiki), or did you dig on it by yourself ? As far as i can see, you are having the SKU in your search query, I see "sku^16" so the field is taken into account. the fields with weight = 1 are "not" really ignored, they are removed from the query because all searchable fields are copied into the "search" meta-field. So there is no point adding them to the query with a weight of 1. Only fields with weight >1 are explicitely added to the query to ensure their matches scores are properly computed (with their weight multiplicator). You will say that in your case, we are not querying the "search" field but the "spelling" one. This is due to the fact that prior your request, Elasticsuite engine did calculate that this query has to be a "spellchecked" one, due to the fact that no exact matching are found into the index for your query string. The "spelling" field work the same way than the "search" one, except it contains only a copy of the fields that are "is_used_in_spellcheck=1". But coming back to your issue, it seems to be a duplicate of #797 which has been fixed on the master branch. You can see the code in the PR #810 Maybe you could give a try to dev-master branch to see if it fixes your issue. Do not hesitate if you have any other questions. Best regards |
Thank @romainruaud for you quick and complete response!! Answering your first question, it was a mix of reading the documentation and then checking the code. For me, in many cases it is easier to read the code rather than the documentation (even more when is a well written code as yours) I was having some issues in my approach with this elasticsuite/src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Spellchecker.php Line 80 in 8095176
The problem is that in case it is not an exact match, the type was elasticsuite/src/module-elasticsuite-core/Search/Request/Query/Fulltext/QueryBuilder.php Line 82 in 8095176
And then the analyzer was always the Now I'm testing adding the code of the PR you suggested via a patch. Just for curiosity, do you have an estimated date for the release of version 2.6.0? Thanks a lot for your help, it was really helpful! |
Hi @facundocapua, The partial sku search as implemented in #810 is intended to work on part of sku when changing the character type. As an example if you have 124A-EE1, you will search for 124, A EE and 1. You will have to write a plugin for the spellchecker to detect if a fuzzy search is not part of an actual sku. We do not plan anything for this because we plan to rewrite completely the spellchecker in the future. I have some concerns about your autocomplete analyzer and think it can result in a weaker precision for the overall search. |
we have installed and set up elasticsuite with Magento 2.3 and elastics search is working pretty good when we tested with some SKU. but there are some instances of the search in which it is not returning the result as expected. For example, when we search with the ISD-TN450 it is returning the correct results but when we search with the ISD-TN45 it is not returning any result. We have checked the demo at http://demo.magento-elastic-suite.io/ and search with the keyword WT09 it is returning the exact result but when we search with the keyword WT0 it is not showing any result. but the product exists and showing on the website. Please suggest if we are missing something in our configuration. |
I have a requirement in a project that the SKU should match partially in the autocomplete, so my approach was the following.
I added an analyzer for the SKU field in this way:
elasticsuite_analysis.xml:
And elasticsuite_indices.xml:
The mapping was done as expected, however I'm not getting the SKU in the search query, this is an extract of the generated query:
Doing some debugging I see that the code removed the SKU from the fields to search is this line:
elasticsuite/src/module-elasticsuite-core/Index/Mapping.php
Line 171 in 51f16c1
I have a few questions:
Thanks a lot and congratulations for such a great module!
The text was updated successfully, but these errors were encountered: