Copied to clipboard

Flag this post as spam?

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


  • Chris 9 posts 29 karma points
    Feb 02, 2011 @ 22:28
    Chris
    0

    Examine - Combining Fuzzy with Boost

    Is it possible to make search within a field "Fuzzy" and yet "Boosted", but am running into two problems doing so. Is it possible to combine Fuzzy with Boost, and if so, how? I'm trying to do:

    searchTerm.Fuzzy().Then().Boost(boostiness)

    but am getting an ArgumentNullException on s. I also tried:

    searchTerm.Fuzzy().Then(searchTerm).Boost(boostiness)

    which solves the ArgumentNullException, but prevents Examine from returning results. The same thing happens if I use Boost and Fuzzy in the other order. I am probably doing something wrong, but am not sure what that would be.

    Any help would be appreciated.

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Feb 03, 2011 @ 00:50
    Aaron Powell
    0

    Can you provide the full stack trace

  • Chris 9 posts 29 karma points
    Feb 03, 2011 @ 18:21
    Chris
    0

    The stack trace is as follows:

       at Examine.LuceneEngine.SearchCriteria.LuceneSearchExtensions.Then(IExamineValue examineValue, String s)
       at Examine.LuceneEngine.SearchCriteria.LuceneSearchExtensions.Then(IExamineValue examineValue)
       at ExamineTest.usercontrols.SearchResults.Page_Load(Object sender, EventArgs e)
    

    The simplest case I could produce that generates the error is as follows:

    ISearchCriteria filter = criteria.Field("nodeName", SearchTerm.Boost(10.0f).Then().Fuzzy()).Compile();
    

    or any of the variations of Boost/Fuzzy/Then chaining on SearchTerm that are shown in the original post.

    I know I'm doing something wrong here but but I'm not sure what. nodeName is in the index and if no "fuzziness" is applied then it can be searched successfully.

    Thank you for looking into it.

  • Bjørn Fridal 274 posts 784 karma points
    Mar 14, 2011 @ 15:01
    Bjørn Fridal
    0

    Hi Chris,

    Did you ever figure out what the problem was? I am in the same situation where combining SearchCriteria extensions, results in a exception.

  • Connie DeCinko 931 posts 1160 karma points
    Sep 29, 2011 @ 00:03
    Connie DeCinko
    0

    Same here, 8 months later and still no one has bothered to answer the initial question.

     

  • Sean Dooley 288 posts 527 karma points
    Feb 03, 2012 @ 17:41
    Sean Dooley
    0

    I have been playing round with the following without getting any exceptions. Just looking at the quality of the results it pulls back

    searchTerm.Fuzzy(0.5f).Then(searchTerm).Boost(0.5f)
  • Connie DeCinko 931 posts 1160 karma points
    Mar 01, 2012 @ 00:58
    Connie DeCinko
    0

    I get this:
    Method not found: 'System.String Examine.LuceneEngine.SearchCriteria.LuceneSearchExtensions.Then(Examine.SearchCriteria.IExamineValue, System.String)'.

    When I try this:

    .Field("name", SearchName.Escape().Then(SearchName).Fuzzy())
  • James Diacono 16 posts 435 karma points
    Oct 23, 2012 @ 07:44
    James Diacono
    0

    Been poking around under the hood - the "Then()" extension method has been commented out in recent releases.  However, if you want to risk it you can actually just do this:

    .Field("name",SearchName.Fuzzy().Value.Boost(1.2f))

    seeing as Fuzzy and Boost are string extensions, and you seem to be able to clump multiple IExamineValues together as strings.

Please Sign in or register to post replies

Write your reply to:

Draft