diff --git a/modules/grouping/src/java/org/apache/lucene/search/grouping/AbstractFirstPassGroupingCollector.java b/modules/grouping/src/java/org/apache/lucene/search/grouping/AbstractFirstPassGroupingCollector.java index bc8d9908647..a5d8164ef1c 100644 --- a/modules/grouping/src/java/org/apache/lucene/search/grouping/AbstractFirstPassGroupingCollector.java +++ b/modules/grouping/src/java/org/apache/lucene/search/grouping/AbstractFirstPassGroupingCollector.java @@ -60,6 +60,7 @@ abstract public class AbstractFirstPassGroupingCollector exten * @param topNGroups How many top groups to keep. * @throws IOException If I/O related errors occur */ + @SuppressWarnings({"unchecked","rawtypes"}) public AbstractFirstPassGroupingCollector(Sort groupSort, int topNGroups) throws IOException { if (topNGroups < 1) { throw new IllegalArgumentException("topNGroups must be >= 1 (got " + topNGroups + ")"); @@ -284,7 +285,7 @@ abstract public class AbstractFirstPassGroupingCollector exten if (orderedGroups != null) { orderedGroups.add(group); assert orderedGroups.size() == topNGroups; - final CollectedSearchGroup newLast = orderedGroups.last(); + final CollectedSearchGroup newLast = orderedGroups.last(); // If we changed the value of the last group, or changed which group was last, then update bottom: if (group == newLast || prevLast != newLast) { for (FieldComparator fc : comparators) { @@ -295,8 +296,8 @@ abstract public class AbstractFirstPassGroupingCollector exten } private void buildSortedSet() { - final Comparator comparator = new Comparator() { - public int compare(CollectedSearchGroup o1, CollectedSearchGroup o2) { + final Comparator> comparator = new Comparator>() { + public int compare(CollectedSearchGroup o1, CollectedSearchGroup o2) { for (int compIDX = 0;; compIDX++) { FieldComparator fc = comparators[compIDX]; final int c = reversed[compIDX] * fc.compare(o1.comparatorSlot, o2.comparatorSlot); diff --git a/modules/grouping/src/java/org/apache/lucene/search/grouping/AbstractSecondPassGroupingCollector.java b/modules/grouping/src/java/org/apache/lucene/search/grouping/AbstractSecondPassGroupingCollector.java index b3505175b03..6dbfcd40270 100644 --- a/modules/grouping/src/java/org/apache/lucene/search/grouping/AbstractSecondPassGroupingCollector.java +++ b/modules/grouping/src/java/org/apache/lucene/search/grouping/AbstractSecondPassGroupingCollector.java @@ -66,7 +66,7 @@ public abstract class AbstractSecondPassGroupingCollector exte for (SearchGroup group : groups) { //System.out.println(" prep group=" + (group.groupValue == null ? "null" : group.groupValue.utf8ToString())); - final TopDocsCollector collector; + final TopDocsCollector collector; if (withinGroupSort == null) { // Sort by score collector = TopScoreDocCollector.create(maxDocsPerGroup, true); @@ -124,7 +124,7 @@ public abstract class AbstractSecondPassGroupingCollector exte final GroupDocs[] groupDocsResult = (GroupDocs[]) new GroupDocs[groups.size()]; int groupIDX = 0; - for(SearchGroup group : groups) { + for(SearchGroup group : groups) { final SearchGroupDocs groupDocs = groupMap.get(group.groupValue); final TopDocs topDocs = groupDocs.collector.topDocs(withinGroupOffset, maxDocsPerGroup); groupDocsResult[groupIDX++] = new GroupDocs(topDocs.getMaxScore(), @@ -146,9 +146,9 @@ public abstract class AbstractSecondPassGroupingCollector exte public class SearchGroupDocs { public final GROUP_VALUE_TYPE groupValue; - public final TopDocsCollector collector; + public final TopDocsCollector collector; - public SearchGroupDocs(GROUP_VALUE_TYPE groupValue, TopDocsCollector collector) { + public SearchGroupDocs(GROUP_VALUE_TYPE groupValue, TopDocsCollector collector) { this.groupValue = groupValue; this.collector = collector; } diff --git a/modules/grouping/src/java/org/apache/lucene/search/grouping/BlockGroupingCollector.java b/modules/grouping/src/java/org/apache/lucene/search/grouping/BlockGroupingCollector.java index b2436255f57..60739c0b239 100644 --- a/modules/grouping/src/java/org/apache/lucene/search/grouping/BlockGroupingCollector.java +++ b/modules/grouping/src/java/org/apache/lucene/search/grouping/BlockGroupingCollector.java @@ -254,7 +254,7 @@ public class BlockGroupingCollector extends Collector { this.topNGroups = topNGroups; final SortField[] sortFields = groupSort.getSort(); - comparators = new FieldComparator[sortFields.length]; + comparators = new FieldComparator[sortFields.length]; compIDXEnd = comparators.length - 1; reversed = new int[sortFields.length]; for (int i = 0; i < sortFields.length; i++) { @@ -290,7 +290,7 @@ public class BlockGroupingCollector extends Collector { * @param fillSortFields If true then the Comparable * values for the sort fields will be set */ - public TopGroups getTopGroups(Sort withinGroupSort, int groupOffset, int withinGroupOffset, int maxDocsPerGroup, boolean fillSortFields) throws IOException { + public TopGroups getTopGroups(Sort withinGroupSort, int groupOffset, int withinGroupOffset, int maxDocsPerGroup, boolean fillSortFields) throws IOException { //if (queueFull) { //System.out.println("getTopGroups groupOffset=" + groupOffset + " topNGroups=" + topNGroups); @@ -339,7 +339,7 @@ public class BlockGroupingCollector extends Collector { final Object[] groupSortValues; if (fillSortFields) { - groupSortValues = new Comparable[comparators.length]; + groupSortValues = new Comparable[comparators.length]; for(int sortFieldIDX=0;sortFieldIDX { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; - SearchGroup that = (SearchGroup) o; + SearchGroup that = (SearchGroup) o; if (groupValue == null) { if (that.groupValue != null) { @@ -113,7 +113,7 @@ public class SearchGroup { // Only for assert private boolean neverEquals(Object _other) { if (_other instanceof MergedGroup) { - MergedGroup other = (MergedGroup) _other; + MergedGroup other = (MergedGroup) _other; if (groupValue == null) { assert other.groupValue != null; } else { @@ -130,7 +130,7 @@ public class SearchGroup { assert neverEquals(_other); if (_other instanceof MergedGroup) { - MergedGroup other = (MergedGroup) _other; + MergedGroup other = (MergedGroup) _other; if (groupValue == null) { return other == null; } else { @@ -158,7 +158,7 @@ public class SearchGroup { public GroupComparator(Sort groupSort) throws IOException { final SortField[] sortFields = groupSort.getSort(); - comparators = new FieldComparator[sortFields.length]; + comparators = new FieldComparator[sortFields.length]; reversed = new int[sortFields.length]; for (int compIDX = 0; compIDX < sortFields.length; compIDX++) { final SortField sortField = sortFields[compIDX]; diff --git a/modules/grouping/src/java/org/apache/lucene/search/grouping/TopGroups.java b/modules/grouping/src/java/org/apache/lucene/search/grouping/TopGroups.java index 36081333c9d..5739d76b2da 100644 --- a/modules/grouping/src/java/org/apache/lucene/search/grouping/TopGroups.java +++ b/modules/grouping/src/java/org/apache/lucene/search/grouping/TopGroups.java @@ -124,7 +124,7 @@ public class TopGroups { for(int shardIDX=0;shardIDX extends AbstractAllGroupHeadsCollector { +public abstract class TermAllGroupHeadsCollector> extends AbstractAllGroupHeadsCollector { private static final int DEFAULT_INITIAL_SIZE = 128;