This code searches for the slug in the index but does not do an exact match. This appears to be a limitation/feature of Lucene I believe, not a Merchello issue. The index returns all matches (even partial as its Lucene) and the Merchello code does a FirstOrDefault so you get the product that is first in the index.
So...is this now a problem for Merchello users? It was certainly an issue for me. I have solved the issue by creating my own IContentFinder which is based on GetBySlug but gets all Lucene matches. I then iterate through them manually looking for the exact match and then get that product from Merchello using it's SKU.
I would be a happy to add this logic to Merchello.Web.Search.CachedProductQuery.GetBySlug(string slug) and do a pull request. It's only a few lines. But before I do, is this a required change or is the current partial match acceptable by design?
I'm receiving a very similar issue as that to the OP.
Within our umbraco solution, we are using the special umbraco property alias 'umbracoUrlAlias' to allow the content editor's to provide multiple Urls for a given node/page (not a merchello product node)
Say for example we have a product with the Url slug:
this-is-very-unique
this product will be accessible on the following Urls:
site.com/this-is-very-unique
site.com/this-is-very
site.com/this-is
site.com/this
site.com/this-very-unique
site.com/this-unique
site.com/unique
basically, any combination you can think of using the above Url slug
now say for example a content node with a value of 'unique' is entered for the umbracoUrlAlias property.
Instead of getting the content node, you're getting the product. I'm presuming this is due to the merchello content finder / url finder are being called before the umbraco's.
I'm running multi language, and links to the product in a alternate language don't seem to work for me.
I've tried a different render (url slug) value for a product in both of the two languages e.g:
"myproducten"
And I get a 404 error.
But if I don't use that method of showing the alternate language product, how can I show the alternate language product details on a page? when the link to it was eg. /en/myproduct/ or for german(swiss) /ch/myproduct/
So /ch/myproduct/ works fine. /en/myproduct/ gets a 404.
URL slug not an exact match
Let's say I have two products with the url slugs:
Product 1: /my-product
and
Product 2: /my-product-extra
If I browse to www.mymerchello.com/my-product I cannot be certain which product will actually be displayed. This seems to be an issue in
This code searches for the slug in the index but does not do an exact match. This appears to be a limitation/feature of Lucene I believe, not a Merchello issue. The index returns all matches (even partial as its Lucene) and the Merchello code does a FirstOrDefault so you get the product that is first in the index.
So...is this now a problem for Merchello users? It was certainly an issue for me. I have solved the issue by creating my own IContentFinder which is based on GetBySlug but gets all Lucene matches. I then iterate through them manually looking for the exact match and then get that product from Merchello using it's SKU.
I would be a happy to add this logic to Merchello.Web.Search.CachedProductQuery.GetBySlug(string slug) and do a pull request. It's only a few lines. But before I do, is this a required change or is the current partial match acceptable by design?
Hey Kevin,
I think you may be encountering this issue http://issues.merchello.com/youtrack/issue/M-1279 ... what version of Merchello are you running?
I am using Merchello 2.3.0. I have looked at your fix. It is the same as mine except I have implemented a new class. Thanks Rusty.
Hey,
I'm receiving a very similar issue as that to the OP.
Within our umbraco solution, we are using the special umbraco property alias 'umbracoUrlAlias' to allow the content editor's to provide multiple Urls for a given node/page (not a merchello product node)
Say for example we have a product with the Url slug:
this-is-very-unique
this product will be accessible on the following Urls:
now say for example a content node with a value of 'unique' is entered for the umbracoUrlAlias property.
Instead of getting the content node, you're getting the product. I'm presuming this is due to the merchello content finder / url finder are being called before the umbraco's.
Basically, is this an error, or by design?
Merchello version: 2.1.0 Umbraco version: 7.4.3
This was an issue http://issues.merchello.com/youtrack/issue/M-1279 - fixed in Merchello 2.4.0
Hey rusty/kevin
I'm running multi language, and links to the product in a alternate language don't seem to work for me.
I've tried a different render (url slug) value for a product in both of the two languages e.g: "myproducten" And I get a 404 error.
But if I don't use that method of showing the alternate language product, how can I show the alternate language product details on a page? when the link to it was eg. /en/myproduct/ or for german(swiss) /ch/myproduct/
So /ch/myproduct/ works fine. /en/myproduct/ gets a 404.
In merchello.config I have:
Any code examples would help a lot.
Thanks Peter
Hi Pete,
did you find a solution for this? I am experiencing the same problem.
Thanks a lot
is working on a reply...