Copied to clipboard

Flag this post as spam?

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


  • Sean Dooley 289 posts 528 karma points
    Dec 20, 2011 @ 11:37
    Sean Dooley
    0

    Examine - missing Fuzzy & Boost?

    Trying to use Fuzzy and Boost as follows

    var test = searchCriteria.Field("nodeName", "hello".Fuzzy(0.8)).Complie();

    But keep getting missing reference error

    'string' does not contain a definition for 'Fuzzy' and no extension method 'Fuzzy' accepting a first argument of type 'string' could be found (are you missing a using directive or an assembly reference?)

    Using Umbraco 4.7.1.Beta - any ideas?

  • Robert Dolman 22 posts 42 karma points
    Jan 25, 2012 @ 11:34
    Robert Dolman
    0

    I ran into this same problem, been scratching my head for a while now, finally found the namespace to include;

        @using Examine.LuceneEngine.SearchCriteria;

    From the code I suspect, like me, you were looking at this article,

        http://umbraco.com/follow-us/blog-archive/2011/9/16/examining-examine.aspx

    The code in that article has a small but very important typo and you'll get a message similar to;

     error CS1928: 'string' does not contain a definition for 'Fuzzy' and the
     best extension method overload 'Examine.LuceneEngine.SearchCriteria.LuceneSearchExtensions.Fuzzy(string,
     float)' has some invalid arguments

    The 0.8 will default to a double in c# so you're line of code should read;

        var test = searchCriteria.Field("nodeName", "hello".Fuzzy(0.8f)).Complie();

  • Connie DeCinko 931 posts 1160 karma points
    Jul 19, 2012 @ 23:56
    Connie DeCinko
    0

    What about fuzzy AND boost.  That was the original question.  Seems lots of problems and no solutions being posted.

     

  • Timothy Lee Russell 20 posts 43 karma points c-trib
    Apr 22, 2015 @ 00:29
    Timothy Lee Russell
    0

    Fuzzy and boost are extension methods.  Make sure you are including the correct namespaces.

    @using Examine;
    @using Examine.SearchCriteria;
    @using Examine.LuceneEngine.SearchCriteria;    <-  This one has Fuzzy / Boost extension methods

     

  • Connie DeCinko 931 posts 1160 karma points
    Apr 22, 2015 @ 19:33
    Connie DeCinko
    0

    I have that one already:

    using Examine;
    using Examine.LuceneEngine.SearchCriteria;
    

    I can get one or the other but not both, Fuzzy AND Boost.

  • Timothy Lee Russell 20 posts 43 karma points c-trib
    Apr 23, 2015 @ 00:23
    Timothy Lee Russell
    0

    @Connie, sorry, I misunderstood.  The original question was about a missing reference.

    After doing some debugging, I think I can give you a somewhat definitive answer that using both Fuzzy AND Boost on the same search phrase is _not_ possible.

    The type that Fuzzy and Boost return is "Examine.LuceneEngine.SearchCriteria.ExamineValue"

    That object has three members:

    • Value = "The string we are searching for"
    • Level = A float between 0 and 1
    • Examineness = This is a Enumeration

            Fuzzy = 0,
            SimpleWildcard = 1,
            ComplexWildcard = 2,
            Explicit = 3,
            Escaped = 4,
            Boosted = 5,
            Proximity = 6,

    Examineness can only be set to a single enum value, so you can pick one and only one enum value for each instance of IExamineValue.

     

     

  • 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