public TermSecondPassGroupingCollector(string groupField, IEnumerable <ISearchGroup <BytesRef> > groups, Sort groupSort, Sort withinGroupSort, int maxDocsPerGroup, bool getScores, bool getMaxScores, bool fillSortFields) : base(groups, groupSort, withinGroupSort, maxDocsPerGroup, getScores, getMaxScores, fillSortFields) { ordSet = new SentinelInt32Set(m_groupMap.Count, -2); this.groupField = groupField; m_groupDocs = /*(SearchGroupDocs<BytesRef>[])*/ new AbstractSecondPassGroupingCollector.SearchGroupDocs <BytesRef> [ordSet.Keys.Length]; }
/// <summary> /// Constructs <see cref="TermDistinctValuesCollector"/> instance. /// </summary> /// <param name="groupField">The field to group by</param> /// <param name="countField">The field to count distinct values for</param> /// <param name="groups">The top N groups, collected during the first phase search</param> public TermDistinctValuesCollector(string groupField, string countField, IEnumerable <ISearchGroup <BytesRef> > groups) { this.groupField = groupField; this.countField = countField; int groupCount = groups.Count(); this.groups = new List <GroupCount>(groupCount); foreach (ISearchGroup <BytesRef> group in groups) { this.groups.Add(new GroupCount(group.GroupValue)); } ordSet = new SentinelInt32Set(groupCount, -2); groupCounts = new GroupCount[ordSet.Keys.Length]; }
internal ScoreAllGroupHeadsCollector(string groupField, Sort sortWithinGroup, int initialSize) : base(groupField, sortWithinGroup.GetSort().Length) { ordSet = new SentinelInt32Set(initialSize, -2); collectedGroups = new JCG.List <GroupHead>(initialSize); SortField[] sortFields = sortWithinGroup.GetSort(); fields = new SortField[sortFields.Length]; for (int i = 0; i < sortFields.Length; i++) { m_reversed[i] = sortFields[i].IsReverse ? -1 : 1; fields[i] = sortFields[i]; } }
/// <summary> /// Expert: Constructs a <see cref="AbstractAllGroupsCollector{BytesRef}"/> /// </summary> /// <param name="groupField">The field to group by</param> /// <param name="initialSize"> /// The initial allocation size of the /// internal int set and group list /// which should roughly match the total /// number of expected unique groups. Be aware that the /// heap usage is 4 bytes * initialSize. /// </param> public TermAllGroupsCollector(string groupField, int initialSize) { ordSet = new SentinelInt32Set(initialSize, -2); groups = new JCG.List <BytesRef>(initialSize); this.groupField = groupField; }
internal TermGroupFacetCollector(string groupField, string facetField, BytesRef facetPrefix, int initialSize) : base(groupField, facetField, facetPrefix) { groupedFacetHits = new List <GroupedFacetHit>(initialSize); segmentGroupedFacetHits = new SentinelInt32Set(initialSize, int.MinValue); }
public SmallDocSet(int size) { intSet = new SentinelInt32Set(size, -1); }