private MultiFacetRequest BuildRequest(int maxResults) { var request = new MultiFacetRequest { Query = Query, Sort = SortFields.ToList(), MaxResults = maxResults, Config = FacetSearcherConfiguration.Default(), Facets = new List <FacetFieldInfo>() }; foreach (var field in Fields) { if (field.MinHits > 0) { request.Config.MinimumCountInTotalDatasetForFacet = field.MinHits; } var fieldInfo = new FacetFieldInfo { FieldName = field.Name, MaxToFetchExcludingSelections = field.MaxCount }; if (field.Values != null) { fieldInfo.Selections = field.Values.ToList(); } request.Facets.Add(fieldInfo); } return(request); }
public MultiFacetQuery(ISearchContext searchContext, string category, Analyzer analyzer, string[] fields, LuceneSearchOptions searchOptions, BooleanOperation occurance) : base(searchContext, category, analyzer, fields, searchOptions, occurance) { _searchContext = searchContext; _request = new MultiFacetRequest { Query = Query, Sort = SortFields, Config = FacetSearcherConfiguration.Default(), Facets = new List <FacetFieldInfo>() }; }
private void Initialize(FacetSearcherConfiguration facetSearcherConfiguration) { FacetSearcherConfiguration = facetSearcherConfiguration ?? FacetSearcherConfiguration.Default(); }
public FacetSearcher(IndexReader reader, IndexReader[] subReaders, int[] docStarts, FacetSearcherConfiguration facetSearcherConfiguration = null) : base(reader, subReaders, docStarts) { Initialize(facetSearcherConfiguration); }
public FacetSearcher(IndexReader r, FacetSearcherConfiguration facetSearcherConfiguration = null) : base(r) { Initialize(facetSearcherConfiguration); }
public FacetSearcher(Directory path, bool readOnly, FacetSearcherConfiguration facetSearcherConfiguration = null) : base(path, readOnly) { Initialize(facetSearcherConfiguration); }
public FacetSearcher(Directory path, FacetSearcherConfiguration facetSearcherConfiguration = null) : base(path) { Initialize(facetSearcherConfiguration); }