private IPromise <INamedFiltersContainer> GetNamedFilters(NamedFiltersContainerDescriptor <familyname> f, string field, List <string> names) { foreach (var n in names) { f.Filter(n, ff => ff.Term(t => t.Field(field).Value(n))); } return(f); }
private static NamedFiltersContainerDescriptor <dynamic> AddNamedFiltersforTaxonomy(Facet facet) { var filterDescriptor = new NamedFiltersContainerDescriptor <dynamic>(); if (facet.Taxonomy != null) { //Get name of unique taxonomy entries var taxonomyList = facet.Taxonomy.Select(x => x.Key).Select(x => x.Name).Distinct().ToList(); foreach (var taxonomyEntry in taxonomyList) { QueryContainer filterQuery = new MatchQuery { Field = facet.Name + ".outbound.value.taxonomy", Query = taxonomyEntry }; filterDescriptor.Filter(taxonomyEntry, filterQuery); } } return(filterDescriptor); }