Copied to clipboard

Flag this post as spam?

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


  • Chris Lomax 1 post 21 karma points
    Sep 26, 2014 @ 10:48
    Chris Lomax
    0

    Umbraco Examine - searching in Child Items from List View

    I'm having issue searching in Umbraco and displaying results from the Child Items in the List View.

    Umbraco Version: 7.1.5

    Using Index Provider - ExternalIndexer (Default external indexer)

    Using Search Provider - ExternalSearcher (Default search provider)

    I was under the impression that the ExternalIndexer was a "catch all" indexer and only excluded none published and none protected nodes.

    I'm not sure how Child Items in a List View work so I'm unsure if this behaviour is even built in.

    The search I am doing is really simple and the code is below...

    @using Examine
    @using Examine.SearchCriteria
    @using UmbracoExamine
    
    @{
      var searchString = Request.QueryString["q"]; //q = "International" in tests
      //var searchProvider = ExamineManager.Instance.SearchProviderCollection["InternalSearcher"].Name;
      var searchProvider = ExamineManager.Instance.DefaultSearchProvider.Name;
      var searchResults = ExamineManager.Instance.SearchProviderCollection[searchProvider].Search(searchString, true);
    }
    
    <ul>
    @foreach (var c in searchResults)
    {
       <li><a href="@umbraco.library.NiceUrl(c.Id)">@c.Fields["nodeName"]</a></li>
    }
    </ul>
    

    The term "International" appears in lots of Child Items from the List Views so it should really return all the child items from our FAQ section.

    Does anyone have any idea why this wouldn't work and also if it is meant to work at all?

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Sep 26, 2014 @ 11:35
    Ismail Mayat
    0

    Chris,

    I would install the ezSearch package and use that for your search, you can go through the code to see how its put together.

    Regards

    Ismail

Please Sign in or register to post replies

Write your reply to:

Draft