private Facet CreateFromContentTag(ISearchContext searchContext, ContentTag tag) { var queryString = searchContext.AsNameValueCollection(); var f = new Facet(tag, "", IsSelected(tag.Value)); // recursively set children f.SetChildren(GetChildren(searchContext, queryString, tag.Children)); return(f); }
private Facet CreateFromAutomatedTag(ISearchContext searchContext, AutomatedTag tag) { var f = new Facet(tag, "", IsSelected(tag.Value)); // TODO this logic needs to be pushed into the automated tag implementation to be more flexible, e.g. sorting might be different per tag (year -> desc) var children = resultSetFacets.Where(facet => facet.Item.Id.Equals(tag.Id)) .Select( facet => new Facet( facet.Item, GetChildQueryString(searchContext, searchContext.AsNameValueCollection(), facet.Item), IsSelected(facet.Item.Value), facet.Count, null)) .OrderBy(facet => facet.Title); f.SetChildren(children); return(f); }