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.
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
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
Hi Dirk,
As instructed on http://www.farmcode.org/?tag=/examine I added this setting to the ExamineIndexProviders in ExamenSettings.config
To the same file under ExaminSearchProviders I added this searchprovider:
then on the ExamineIndex.config file I added this IndexSet:
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
Anthony,
Examine heavily relies on convention over configuration, need to name your indexer EshsmIndexer.
Hope this helps.
Regards,
/Dirk
Yep, it works :)
thanks a lot,
Anthony
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. :)
is working on a reply...