Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Kevin 35 posts 159 karma points
    Mar 27, 2017 @ 12:25

    URL slug not an exact match

    Let's say I have two products with the url slugs:

    Product 1: /my-product


    Product 2: /my-product-extra

    If I browse to I cannot be certain which product will actually be displayed. This seems to be an issue in

    Merchello.Web.Search.CachedProductQuery.GetBySlug(string slug)

    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. 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?

  • Rusty Swayne 1655 posts 4984 karma points c-trib
    Mar 28, 2017 @ 19:58
    Rusty Swayne

    Hey Kevin,

    I think you may be encountering this issue ... what version of Merchello are you running?

  • Kevin 35 posts 159 karma points
    Mar 29, 2017 @ 07:54

    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.

  • Jcr 8 posts 108 karma points
    Apr 21, 2017 @ 17:07


    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 product will be accessible on the following Urls:

    • 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.

    Basically, is this an error, or by design?

    Merchello version: 2.1.0 Umbraco version: 7.4.3

  • Rusty Swayne 1655 posts 4984 karma points c-trib
    Apr 24, 2017 @ 16:15
    Rusty Swayne

    This was an issue - fixed in Merchello 2.4.0

  • Pete 207 posts 278 karma points
    May 17, 2018 @ 11:43

    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:

    <route cultureName="de-CH" productSlugPrefix="ch" />
    <route cultureName="en-US" productSlugPrefix="en" />

    Any code examples would help a lot.

    Thanks Peter

Please Sign in or register to post replies

Write your reply to: