Copied to clipboard

Flag this post as spam?

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


  • Jason D 25 posts 56 karma points
    Mar 15, 2021 @ 20:37
    Jason D
    0

    Umbraco Examine Search with WildCard

    Hi, I am nearly complete on converting a custom .NET site to Umbraco, and the last piece has me in a bind.

    We have a configurator, where there are radio buttons and drop-down choices, which configure a SKU such as "S1-?-?-?-?-?", so that it eventually is a fully configured SKU like "S1-128-D-S-P".

    I created functionality using Examine Search, but the problem I'm having a hard time figure out, is how to search a table of "associations" where it uses wildcards in the place of the "?", so that I can get all associations that have "S1", but anything in the placements of the "?"'s, but then match the 3rd to "D" (Ie., "S1-wildcard-D-wildcard-wildcard-wildcard", or in SQL, the "LIKE "S1-%-D-%-%")

    The main idea is that I need to keep the placements, since the default Examine search of "S1 D" would match "S1-?-D-?-?-?" and also "S1-?-?-?-D-?".

    Any ideas?

  • Huw Reddick 335 posts 1007 karma points
    Mar 15, 2021 @ 20:58
    Huw Reddick
    0

    Did you try using your S1-?-D for your search?

  • Jason D 25 posts 56 karma points
    Mar 15, 2021 @ 21:25
    Jason D
    0

    Yes, it replaces all special characters with spaces, which works, but then there's no place positions in the string, so "S1 D" matches "S1-D-?-?-?", S1-?-D-?-?" or "S1-?-?-?-D-?".

  • Huw Reddick 335 posts 1007 karma points
    Mar 15, 2021 @ 21:36
    Huw Reddick
    0

    Did you enablewildcard searching?

  • Huw Reddick 335 posts 1007 karma points
    Mar 15, 2021 @ 21:52
    Huw Reddick
    0

    You probably need to escape the - character as well think it is reserved character.

  • Jason D 25 posts 56 karma points
    Mar 15, 2021 @ 21:58
    Jason D
    0

    I thought I enabled WildCards by using "MultipleCharacterWildcard", but maybe that's not enough?

  • Huw Reddick 335 posts 1007 karma points
    Mar 15, 2021 @ 22:05
    Huw Reddick
    0

    No that should be fine. Are you using external or internal index? I remember reading s post here where someone mentioned that one of them strips the characters and the other didn't. I'll try and find it.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies