We are using Umbraco for our company website and noticed an issue when using Archetype within the content. When you set content using Archetype to be disabled, it will still show up in your search. Is there an easy way to get the field sets from Archetype so the disable content will not show up in your search?
@foreach (var result in searchResults)
{
var node = Umbraco.TypedContent(result.Id);
var pathIds = result["__Path"].Split(',');
var path = Umbraco.TypedContent(pathIds).Where(p => p != null).Select(p=> new {p.Name}).ToList();
Content Search Issue with Archetype
We are using Umbraco for our company website and noticed an issue when using Archetype within the content. When you set content using Archetype to be disabled, it will still show up in your search. Is there an easy way to get the field sets from Archetype so the disable content will not show up in your search?
The code we are using for search
@{ var searchTerm = Request.QueryString["q"];
}
Search Results for @searchTerm
@Html.Partial("Includes/siteSearch", Model.Content)
@if (searchResults.Any()) {
@foreach (var result in searchResults) { var node = Umbraco.TypedContent(result.Id); var pathIds = result["__Path"].Split(','); var path = Umbraco.TypedContent(pathIds).Where(p => p != null).Select(p=> new {p.Name}).ToList();
} else {
There are no results matching your search criteria:
}
Hi Antoinette,
You need to index the Archetype content. This is done by implementing the GatheringNodeData of the index you want.
Here are some examples. One of them is from Kevin Creator of Archetype .
http://nathanw.com.au/blog/indexing-archetype-content-in-umbraco/
Kevin sample https://gist.github.com/kgiszewski/aa48da36733aa05e1acddd167da2b99a
video of Kevin on Youtube
https://www.youtube.com/watch?v=526X0B_sqFw
Thank you.
is working on a reply...