Copied to clipboard

Flag this post as spam?

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


  • Nathan Woulfe 447 posts 1664 karma points MVP 5x hq c-trib
    Sep 15, 2014 @ 02:55
    Nathan Woulfe
    0

    Examine - return only exact matches

    Given a site where node names are like the list below, how can I use Examine to return only nodes with an exactly matched name?

    foo
    bar
    foobar
    foo foo bar

    If I search 'bar', I only want the second node returned.

    I thought I could use regex in the search term (something like "+nodeName:\"/^{0}$" where {0} is the query) to match on the start and end of the string, but that's not working - it returns all nodes that include the query.

    Also tried an inclusive range ("+nodeName: [{0} TO {0}]") which returned nothing.

    Any ideas would be awesome...

     

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Sep 15, 2014 @ 08:41
    Ismail Mayat
    0

    Nathan,

    After a bit of digging around i found http://blogs.perl.org/users/mark_leighton_fisher/2012/01/stupid-lucene-tricks-exact-match-starts-with-ends-with.html another thing you could try is in luke do the search but change the analyser to keyword analyser see if that works?

    Regards

    Ismail

  • Nathan Woulfe 447 posts 1664 karma points MVP 5x hq c-trib
    Sep 15, 2014 @ 08:55
    Nathan Woulfe
    0

    Thanks Ismail - I gave up on using Examine for this one, just grabbed the content I needed with the Umbraco API instead.

Please Sign in or register to post replies

Write your reply to:

Draft