Copied to clipboard

Flag this post as spam?

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


  • Michael Sims 119 posts 387 karma points
    Aug 08, 2013 @ 00:38
    Michael Sims
    0

    Search not working as expected

    I have a number of content items titled in the format of "{Month} What's On". When I search for this it returns a matching result, however, when I search for "What's On {Month}" it finds 0 results.

      var criteria = ExamineManager.Instance.SearchProviderCollection["WebsiteSearcher"].CreateSearchCriteria();
     Examine.SearchCriteria.IBooleanOperation filter = null;

      var fields = new string[] { "nodeName", "pageTitle", "pageShort", "pageContent", "uBlogsyContentTitle", "uBlogsyContentSummary", "uBlogsyContentBody" };

      filter = criteria.GroupedOr(fields, term);

      var searchResults = Examine.ExamineManager.Instance

        .SearchProviderCollection["WebsiteSearcher"]
        .Search(filter.Compile())
        .OrderByDescending(x => x.Score);

    Anyone got an idea of how I can get it to return the results irrelevant of the order of the words?

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Aug 09, 2013 @ 08:57
    Jeavon Leopold
    0

    Hi Michael,

    I think what your after is described in the excellent blog post http://smdool.co.uk/umbraco-examine-multiple-word-search as it splits the words up

    Hope that's helpful,

    Jeavon

Please Sign in or register to post replies

Write your reply to:

Draft