Copied to clipboard

Flag this post as spam?

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


  • Thomas Won Nyheim 32 posts 144 karma points
    Nov 13, 2018 @ 13:04
    Thomas Won Nyheim
    0

    Examine and understanding the result

    Hi,

    I've set up a examine search like this

    var q = vehicleData.SearchQuery.Trim();
    var Searcher = ExamineManager.Instance.SearchProviderCollection["RoofBoxSearcher"];
    var searchCriteria = Searcher.CreateSearchCriteria(Examine.SearchCriteria.BooleanOperation.Or);
    var query = searchCriteria.GroupedOr(new string[] { "vehicleType", "vehicleModel" }, q.Fuzzy(0.01f)).Compile();
    IEnumerable<SearchResult> searchResults = Searcher.Search(query).OrderByDescending(x => x.Score).TakeWhile(x => x.Score > 0.05f);
    

    The available elements in vehicleTypes are:

    Alfa Romeo 159 Sportwagon

    Alfa Romeo Stelvio

    When I try the input "Alfa Ro" it returns the two results, however when i try with Alfa Rom or Alfa Romeo it doesn't return anything. Is there something I'm missing or misunderstanding as to why this is not working?

    Same goes for "Alfa st", also returns one result and again no results for "Alfa Stelvio"

  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Nov 13, 2018 @ 14:03
    Ismail Mayat
    0

    Try taking off the fuzzy on q and use wildcard. also you dont need to sort by score its already sorted by score by default

  • Thomas Won Nyheim 32 posts 144 karma points
    Nov 13, 2018 @ 14:26
    Thomas Won Nyheim
    0

    Removed the fuzzy, added * in front and after the query string. The result was that it returned two hits for "Alfa" and zero hits for "Alfa R", "Alfa Ro", "Alfa Rom" and "Alfa Rome", but two hits again for "Alfa Romeo"

Please Sign in or register to post replies

Write your reply to:

Draft