コード例 #1
0
 public static void ParseSuperFacetQuery(this Query query, IFieldSet fieldSet, int maxItems, int publicationId)
 {
     maxItems = FacetedContentHelper.AssertCappedViewSize(maxItems);
     Location location = query.getLocation();
     ValueSet lowSet = new ValueSet(ValueSet.AggregationType.OR);
     foreach (KeyValuePair<string, IField> pair in fieldSet)
     {
         foreach (IKeyword keyword in pair.Value.Keywords)
         {
             string str = PathToFacetPath(keyword.Path, publicationId);
             lowSet.add(str);
         }
     }
     MultiValuedCriterion criterion = new MultiValuedCriterion(string.Format("{0}_super_facet", publicationId), lowSet, null, false);
     location.addCriterion(criterion);
     query.setListViewSize(maxItems);
 }