Copied to clipboard

Flag this post as spam?

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


  • Anthony Candaele 1197 posts 2049 karma points
    Jun 28, 2011 @ 11:47
    Anthony Candaele
    0

    Problem implementing Examine search

    Hi, I'm trying to implement the Examine search functionality as outlined on FarmCode.org:

    http://www.farmcode.org/?tag=/examine

    However, when I try to run a search on my search results page where I inserted my Examine Search razor macro, I get this error message:

    The type initializer for 'Examine.ExamineManager' threw an exception.

    Has anyone experience with this error when implementing Examine search functionality?

    Thanks for your help,

    Anthony Candaele
    Belgium

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jun 28, 2011 @ 12:15
    Dirk De Grave
    1

    Anthony,

    This is probably a config error. Can you show us your configuration? Hard to tell what' wrong based on this single error message.

     

    Cheers,

    /Dirk

  • Anthony Candaele 1197 posts 2049 karma points
    Jun 28, 2011 @ 13:41
    Anthony Candaele
    0

    Hi Dirk,

    As instructed on http://www.farmcode.org/?tag=/examine I added this setting to the ExamineIndexProviders in ExamenSettings.config

    <add name="Eshms"
           type="UmbracoExamine.UmbracoContentIndexer, UmbracoExamine"/>

    To the same file under ExaminSearchProviders I added this searchprovider:

    <add name="EshmsSearcher"
            type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine"/>

    then on the ExamineIndex.config file I added this IndexSet:

    <IndexSet SetName="EshmsIndexSet"
        IndexPath="~/App_Data/TEMP/Eshms"

    my Razor script file looks like this (I just copied this from the FarmCode site):

    @using Examine;

    @* Get the search term from query string *@
    @{var searchTerm = Request.QueryString["search"];}

    <ul class="search-results">
    @foreach (var result in
        ExamineManager.Instance.Search(searchTerm, true)) {    
       
        <li>
            <span>@result.Score</span>
            <a href="@umbraco.library.NiceUrl(result.Id)">
                @result.Fields["nodeName"]
            </a>        
        </li>    
       
    }
    </ul>

    Thanks for your help,

    Anthony

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jun 28, 2011 @ 13:44
    Dirk De Grave
    0

    Anthony,

    Examine heavily relies on convention over configuration, need to name your indexer EshsmIndexer.

     

    Hope this helps.

    Regards,

    /Dirk

  • Anthony Candaele 1197 posts 2049 karma points
    Jun 28, 2011 @ 13:50
    Anthony Candaele
    0

    Yep, it works :)

    thanks a lot,

    Anthony

  • ivan 41 posts 182 karma points
    Sep 12, 2011 @ 06:59
    ivan
    0

    Hello everyone..this is my first time in umbraco..:)

    i have some question.. i have encountered an error : Error loading Razor Script search.cshtmlThe type initializer for 'Examine.ExamineManager' threw an exception.

    i already added my ExamineSettings.config & ExamineIndex even my dll.

    thanks. :)

     

  • Mridul 2 posts 22 karma points
    Mar 22, 2012 @ 07:31
    Mridul
    0
Please Sign in or register to post replies

Write your reply to:

Draft