Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
i'm trying to search, using examine, a term into a treenodepicker. I wrote this:
@inherits Umbraco.Web.Macros.PartialViewMacroPage
@using Examine
@using Examine.SearchCriteria
@using UmbracoExamine
@{
var searchString = "3371";
var criteria = ExamineManager.Instance.CreateSearchCriteria();
var expression = criteria.Field("aree", searchString);
var searchResults = ExamineManager.Instance.Search(expression.Compile());
}
<ul>
@foreach (var c in searchResults)
{
<li><a href="@umbraco.library.NiceUrl(c.Id)">@c.Fields["nodeName"]</a></li>
</ul>
field "aree" contains the values of the treenodpicker
If i have only one value the partial view retrive result.
If the field aree have more than one value, i can't retrieve documents
So I tried to use fuzzy()
var expression = criteria.Field("aree", searchString.Fuzzy());
but it gives me error!
Error loading Partial View script (file: ~/Views/MacroPartials/xxxxxxx.cshtml)
Regards
Stefano
Hi Stefano,
Have you looked to see if there are any errors within your log files? If so, what are they?
Dan.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Error loading Partial View script...
Hi,
i'm trying to search, using examine, a term into a treenodepicker. I wrote this:
@inherits Umbraco.Web.Macros.PartialViewMacroPage
@using Examine
@using Examine.SearchCriteria
@using UmbracoExamine
@{
var searchString = "3371";
var criteria = ExamineManager.Instance.CreateSearchCriteria();
var expression = criteria.Field("aree", searchString);
var searchResults = ExamineManager.Instance.Search(expression.Compile());
}
<ul>
@foreach (var c in searchResults)
{
<li><a href="@umbraco.library.NiceUrl(c.Id)">@c.Fields["nodeName"]</a></li>
}
</ul>
field "aree" contains the values of the treenodpicker
If i have only one value the partial view retrive result.
If the field aree have more than one value, i can't retrieve documents
So I tried to use fuzzy()
var expression = criteria.Field("aree", searchString.Fuzzy());
but it gives me error!
Error loading Partial View script (file: ~/Views/MacroPartials/xxxxxxx.cshtml)
Regards
Stefano
Hi Stefano,
Have you looked to see if there are any errors within your log files? If so, what are they?
Dan.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.