Hi guys,
I'm pretty new to Umbraco and I'm trying to get a more advanced search on the go.
I've managed to implement a simple site search using the default ExternalIndexer, but I'm looking to create another search that uses my own Indexer.
I've updated my ExamineSettings.config and ExamineIndex.config files and verified my new index is working as intended by using the Examine Management tab and running searches using my new search indexer that appears under 'Searchers'.
I have a simple Partial View setup, using the code from the Fluent API section of the quick start guide, however, I can't seem to render anything other than the node Id.
Here's my Partial View code:
@inherits Umbraco.Web.Macros.PartialViewMacroPage
@using Examine.LuceneEngine.SearchCriteria;
@{
var query = Request.QueryString["query"];
var searcher = Examine.ExamineManager.Instance.SearchProviderCollection["MySearchSearcher"];
var searchCriteria = searcher.CreateSearchCriteria(Examine.SearchCriteria.BooleanOperation.Or);
var searchQuery = searchCriteria.Field("nodeName", query.Boost(5)).Or().Field("nodeName", query.Fuzzy()).And().OrderByDescending("createDate");
var searchResults = searcher.Search(searchQuery.Compile());
if(searchResults.Any())
{
<ul>
@foreach (var result in searchResults)
{
<li>
@result.Id;
</li>
}
</ul>
}
}
This renders the ID of expected results, but when I try to use @result.nodeName or @result.Url, I get a compiler error message:
CS1502: The best overloaded method match for 'System.Web.WebPages.WebPageExecutingBase.Write(System.Web.WebPages.HelperResult)' has some invalid arguments
How can I output and render other values, including custom doctype fields?