We have products as following
"Screw for Example Product"
"Mount for Example Product"
"Example Product 1"
"Example Product 2"
no when searching for "Example". the actual product, not the spare parts should be shown first.
Is there a boosting for products which are starting with the query string?
Hello @amenk
Unfortunately, such way to boost products does not exists, and I'm afraid it's not as simple as that. It could fit your usecase but would probably bother other users.
Maybe you could have a generic Optimizer which is always applied on "real products" and not on "spare parts" (according there is a way to differentiate them, like their attribute set maybe ?). It should not necessitate a huge boost factor to work since the score difference between the products should be tiny by default (they matched both, so they probably have a similar score).
Regards
@amenk can this be considered as anwered (and then closed) ?
Let us know if you need more details,
Regards
We probably go for a "real product" distinction and boost them.
Anyways, do you think and option to boost matches where the search string is at the beginning is possible (programmatically) and/or would make sense as an option to be delivered with the package (to not bother other users) ?
This question came up with another customer. I think it is quite common that people expect the results to start with the string typed.
In that case a generic booster on such products is not possible.
How can this be implemented? (as on configuration option, or custom module?)
Open for advice :-)
In 99% in situations when customers search something, they expect to see items have name is starting with search query.
Everything else is a bug or unwanted functionality. But in official response from ADOBE they call this "marketing".
But because of this marketing , many buyers do not come back to my store.
@ivankakurov why so grumpy? Which offical repsonse from Adobe are you talking about? SmileSA is not Magento/Adobe
I am still very interested in this issue.
@amenk i say just this is very very big problem in all magento2 stores.
I know for that is SmileSA is not a Adobe, but i have hope for this plugin.
I created very limited solution only for mysql, whithout fulltext search.
But that solution worked fine when use 3-4 searchable filed.
prat of that is here:
https://github.com/Smile-SA/elasticsuite/issues/1383
@ivankakurov ah, okay, got it :-)
Imho this feature is something very tied to merchants business :
the "spare part" example given by @amenk is completely relevant to me
but on the other hand, at Smile we have now tons of Magento 2 projects, and I never heard of any similar need.
What are you selling on your shop @ivankakurov ? Can you also give me a detailed use case where the displayed search results are not fitting your needs ?
Maybe we could find another way to adress your issue with vanilla Elasticsuite (there's plenty things we can do with Optimizers according to your data).
That being said, my opinion on such a feature is :
name, but we do index many other product dataThe discussion remains open, but please gentlemen keep it respectful :)
Regards
@romainruaud actually our customer did not only mention that with spare parts --- it just feels very natural to him, that beginsWith matches are expected higher in the results, especially during autocomplete typing.
For the autocomplete, I might agree, I'm not sure about the search result page.
@romainruaud We selling office equipment form toilet paper to servers. In my case customers searching for "laptop" but in result page they view first "Bag for laptop","Cleaning set for laptop" etc. On 4-5 page customers see "Laptop HP ...". This is not a problem only on Smile, i see this problem on every shop using magento2. In 90% on situations customers searching from name and description on products, not attributes, comments etc.
I like your work, but i don't have necessary experience with elasticsearch to resolve this issue.
In Mysql i relove this problem whit 4-5 line of code, but have limitation for how many field's can added to searching .
Ok it's clearer for me know.
One workaround I see, is the same I proposed to @amenk previously :
You might identify a common pattern between your "accessories" or "spare parts" products : "cleaning set for XXX", "bag for XXX".
This common pattern could be categories, or even a custom attribute that you'd like to put on all these kind of products (might be an attribute set also).
If something like this can be identified, you can then create a negative boost on it, to lower the ranking of these kind of products in the search engine, by using Optimizers brought by ElasticSuite.
Regards
@romainruaud in my case i can't. All products, attributes and categories are added by different applications. I have no control over what the attributes of a given product will be.
Another big issue is a search by phrase. People expects to get first the results with a 100% match, then results where phrase is part of the name or description. I know this is possible in elastic but not sure how to implement.
Here is how I have solved (or made a workaround) to the problem described:
1) Add new attribute for product name first word (just a dummy product attribute, not visible in admin), make it searchable and let it have the same search weight as name
2) Then plugin Smile\ElasticsuiteCatalog\Model\Product\Indexer\Fulltext\Datasource\AttributeData, using method afterAddData, loop indexdata, find product name and add the first word of name into the attribute you have created in step 1.
3) Now after full reindex the products that have a match in the first word appear before the other products, as first word of the name is a separate entity with separate boost.
@siimm thanks for sharing -- wow that sounds so tiresome
Would be cool if we could fine a core solution for this.
Hello @siimm, @amenk,
That's actually a pretty decent idea which a big hardware company had come up with on their own when trying to boost tools versus accessories for tools.
It will work as expected in romance languages where the most important word is at the front.
For instance "per莽euse" (drill) vs "m猫che de per莽euse" (drill bit).
They also relied on boosting two other semi-computed fields which were very precise.
It certainly helps with you have full control over your catalog data and/or time to refine it/implement custom datasource.
Regards,
Most helpful comment
Here is how I have solved (or made a workaround) to the problem described:
1) Add new attribute for product name first word (just a dummy product attribute, not visible in admin), make it searchable and let it have the same search weight as name
2) Then plugin Smile\ElasticsuiteCatalog\Model\Product\Indexer\Fulltext\Datasource\AttributeData, using method afterAddData, loop indexdata, find product name and add the first word of name into the attribute you have created in step 1.
3) Now after full reindex the products that have a match in the first word appear before the other products, as first word of the name is a separate entity with separate boost.