This line throws an exception when the field is a cropper. I just added an exception handling:
var uFile = e.Fields["umbracoFile"] as dynamic;
try
{
e.Fields["umbracoFileName"] = Path.GetFileName(uFile);
}
catch (System.Exception)
{
var x = new System.Web.Script.Serialization.JavaScriptSerializer().DeserializeObject(uFile)["src"];
e.Fields["umbracoFileName"] = Path.GetFileName(x);
}
When rendering the results in ezsearch.cshtml the helper "RenderResults" breaks when trying to create urls to media folders.
I added a try catch and a check
try
{
switch (result.Fields["__IndexType"])
{
case UmbracoExamine.IndexTypes.Content:
var contentItem = Umbraco.TypedContent(result.Fields["id"]);
@RenderContentResult(model, contentItem)
break;
case UmbracoExamine.IndexTypes.Media:
if (result.Fields["nodeTypeAlias"] != "folder")
{
var mediaItem = Umbraco.TypedMedia(result.Fields["id"]);
@RenderMediaResult(model, mediaItem)
}
break;
}
}
catch (Exception)
{
// need some logging of errors here?
}
There's probably some other build in ways to do this. :)
Some feedback
Hi Matt,
We installed eZsearch and ran into a few problems.
The indexer breaks under certain conditions. In ezSearchBootstrapper.cs
This line throws an exception when the field is a cropper. I just added an exception handling:
When rendering the results in ezsearch.cshtml the helper "RenderResults" breaks when trying to create urls to media folders.
I added a try catch and a check
There's probably some other build in ways to do this. :)
/Jesper
is working on a reply...