Copied to clipboard

Flag this post as spam?

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


  • question 3 posts 51 karma points
    Oct 08, 2014 @ 15:57
    question
    0

    Examine returning no results

    Having an issue with Examine returning no results, it should return.

    1. string key= Request.QueryString["keywords"];
    2.     if (String.IsNullOrWhiteSpace(key))
    3.     {
    4.         key= "";
    5.     }
    6.  
    7.     var searchManager= ExamineManager.Instance;
    8.     var criteria = searchManager.CreateSearchCriteria();
    9.  
    10.     var query = criteria.GroupedOr(new[] { "nodeName""name""title""bodyText""seo" }, key).Compile();
    11.  
    12.     var searchResults = searchManager.Search(query).Where(=> r["__IndexType"] == "content").ToList();
    searchResults is empty.
    How can I solve this porblem?

  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    Oct 08, 2014 @ 18:07
    Alex Skrypnyk
    0

    Hi Question ))

    It's 100% working code, we used it a lot of times.

        var searcher = ExamineManager.Instance.SearchProviderCollection["WebsiteSearcher"];
        var searchCriteria = searcher.CreateSearchCriteria(BooleanOperation.Or);
        //var query = searchCriteria.RawQuery(model.SearchText); 
        var query = searchCriteria.
            Field("bodyText", model.SearchText.Fuzzy(0.3f)).Or().
            .Compile();
    
        var searchResults = searcher.Search(query);
    

    Try to use Examine Inspector for testing your indexes. http://our.umbraco.org/projects/backoffice-extensions/examine-inspector

    Thanks, Alex

Please Sign in or register to post replies

Write your reply to:

Draft