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 SentinelIntSet(groupMap.Count, -2);
     this.groupField = groupField;
     groupDocs       = /*(SearchGroupDocs<BytesRef>[])*/ new AbstractSecondPassGroupingCollector.SearchGroupDocs <BytesRef> [ordSet.Keys.Length];
 }
예제 #2
0
        public TermDistinctValuesCollector(String groupField, String countField, Collection <GroupCount> groups)
        {
            this.groupField = groupField;
            this.countField = countField;
            this.groups     = new List <GroupCount>(groups.Count());
            foreach (GroupCount group in this.groups)
            {
                this.groups.Add(new GroupCount(group.groupValue));
            }

            this.ordSet = new SentinelIntSet(groups.Count(), -2);
            groupCounts = new GroupCount[this.ordSet.Keys.Count()];
        }
예제 #3
0
        internal ScoreAllGroupHeadsCollector(string groupField, Sort sortWithinGroup, int initialSize)
            : base(groupField, sortWithinGroup.GetSort().Length)
        {
            ordSet          = new SentinelIntSet(initialSize, -2);
            collectedGroups = new List <GroupHead>(initialSize);

            SortField[] sortFields = sortWithinGroup.GetSort();
            fields = new SortField[sortFields.Length];
            for (int i = 0; i < sortFields.Length; i++)
            {
                reversed[i] = sortFields[i].Reverse ? -1 : 1;
                fields[i]   = sortFields[i];
            }
        }
예제 #4
0
        /// <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 SentinelIntSet(groupCount, -2);
            groupCounts = new GroupCount[ordSet.Keys.Length];
        }
예제 #5
0
 public SmallDocSet(int size)
 {
     intSet = new SentinelIntSet(size, -1);
 }
예제 #6
0
 internal TermGroupFacetCollector(string groupField, string facetField, BytesRef facetPrefix, int initialSize)
     : base(groupField, facetField, facetPrefix)
 {
     groupedFacetHits        = new List <GroupedFacetHit>(initialSize);
     segmentGroupedFacetHits = new SentinelIntSet(initialSize, int.MinValue);
 }
예제 #7
0
 /// <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 SentinelIntSet(initialSize, -2);
     groups          = new List <BytesRef>(initialSize);
     this.groupField = groupField;
 }
예제 #8
0
		internal TermGroupFacetCollector(string groupField, string facetField, BytesRef facetPrefix
			, int initialSize) : base(groupField, facetField, facetPrefix)
		{
			groupedFacetHits = new AList<GroupedFacetHit>(initialSize);
			segmentGroupedFacetHits = new SentinelIntSet(initialSize, int.MinValue);
		}