Copied to clipboard

Flag this post as spam?

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


  • Kurniawan Kurniawan 202 posts 225 karma points
    Nov 11, 2010 @ 01:41
    Kurniawan Kurniawan
    0

    Examine Search "NOT EXACT" Word

    Hi,

    Is that possible to configure Examine so it can search just a partial word /
    "contains" string ?

    forexample I want search for with "abo" - and my "about" page will appear as well

     

    Thanks

  • Qube 74 posts 116 karma points
    Nov 11, 2010 @ 01:59
    Qube
    0

    Yes you can. There is a extension method included called MultiCharacterWildcard() that appends an appropriate... well... multi character wildcard (an asterisk for Lucene) to the end of a string.

    Your example of "abo" matching "about" is easily reproducable. However, trying to match "bout" in "about" will not perform well, and is not recommended. You should try to stick to "starts with" searches if possible.

    You could also try Fuzzy(), which is based on keyword similarity rather than an exact starting match. That said, I found it gave pretty unexpected results, especially for short words, and it was hard to tune the "fuzziness". I went back to ending keywords with a wildcard and the results were much more logical.

    Here is a topic that documents my journey into the world of Examine in which I make a bunch of stupid mistakes, but ultimately came out with a great solution. Hope it helps!

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Nov 11, 2010 @ 03:03
    Aaron Powell
    0

    Here's a post I did on how search queries are built with Examine: http://farmcode.org/post/2010/08/12/How-to-build-a-search-query-in-Examine.aspx

  • Kurniawan Kurniawan 202 posts 225 karma points
    Nov 11, 2010 @ 03:33
    Kurniawan Kurniawan
    0

    Hi

    What Namespace I have to add. I couldn't find that extension method for a string.

    Fuzzy() / MultiCharacterWildcard()

    Thanks

     

  • Kurniawan Kurniawan 202 posts 225 karma points
    Nov 11, 2010 @ 03:37
    Kurniawan Kurniawan
    0

    Found it.. it's on UmbracoExamine.SearchCriteria namespace

Please Sign in or register to post replies

Write your reply to:

Draft