Skip to content

Apache Lucene open-source search software

SOLR-7103: Remove unused method params in faceting code

Shalin Shekhar Mangar9ace7e16947d
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index f6b17e85b07..07c5f60c084 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -147,6 +147,8 @@ Other Changes
* SOLR-7076: In DIH, TikaEntityProcessor should have support for onError=skip
(Noble Paul)
+* SOLR-7103: Remove unused method params in faceting code. (shalin)
+
================== 5.0.0 ==================
Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.
diff --git a/solr/core/src/java/org/apache/solr/handler/component/FacetComponent.java b/solr/core/src/java/org/apache/solr/handler/component/FacetComponent.java
index f801b0ad3f5..31d2710f8ce 100644
--- a/solr/core/src/java/org/apache/solr/handler/component/FacetComponent.java
+++ b/solr/core/src/java/org/apache/solr/handler/component/FacetComponent.java
@@ -237,7 +237,7 @@ public class FacetComponent extends SearchComponent {
shardsRefineRequest.params.remove(FacetParams.FACET_PIVOT_MINCOUNT);
}
- enqueuePivotFacetShardRequests(null, rb, shardNum);
+ enqueuePivotFacetShardRequests(rb, shardNum);
}
}
}
@@ -245,9 +245,7 @@ public class FacetComponent extends SearchComponent {
return ResponseBuilder.STAGE_DONE;
}
- private void enqueuePivotFacetShardRequests
- (HashMap<String,List<String>> pivotFacetRefinements,
- ResponseBuilder rb, int shardNum) {
+ private void enqueuePivotFacetShardRequests(ResponseBuilder rb, int shardNum) {
FacetInfo fi = rb._facetInfo;
@@ -315,7 +313,7 @@ public class FacetComponent extends SearchComponent {
modifyRequestForFieldFacets(rb, sreq, fi);
- modifyRequestForRangeFacets(sreq, fi);
+ modifyRequestForRangeFacets(sreq);
modifyRequestForPivotFacets(rb, sreq, fi.pivotFacets);
@@ -332,7 +330,7 @@ public class FacetComponent extends SearchComponent {
}
// we must get all the range buckets back in order to have coherent lists at the end, see SOLR-6154
- private void modifyRequestForRangeFacets(ShardRequest sreq, FacetInfo fi) {
+ private void modifyRequestForRangeFacets(ShardRequest sreq) {
// Collect all the range fields.
final String[] fields = sreq.params.getParams(FacetParams.FACET_RANGE);
if (fields != null) {
@@ -596,7 +594,7 @@ public class FacetComponent extends SearchComponent {
// fbs can be null if a shard request failed
if (fbs != null && (sfc.termNum >= fbs.length() || !fbs.get(sfc.termNum))) {
// if missing from this shard, add the max it could be
- maxCount += dff.maxPossible(sfc, shardNum);
+ maxCount += dff.maxPossible(shardNum);
}
}
if (maxCount >= smallestCount) {
@@ -612,7 +610,7 @@ public class FacetComponent extends SearchComponent {
// fbs can be null if a shard request failed
if (fbs != null &&
(sfc.termNum >= fbs.length() || !fbs.get(sfc.termNum)) &&
- dff.maxPossible(sfc, shardNum) > 0) {
+ dff.maxPossible(shardNum) > 0) {
dff.needRefinements = true;
List<String> lst = dff._toRefine[shardNum];
@@ -965,7 +963,7 @@ public class FacetComponent extends SearchComponent {
private void reQueuePivotFacetShardRequests(ResponseBuilder rb) {
for (int shardNum = 0; shardNum < rb.shards.length; shardNum++) {
if (doAnyPivotFacetRefinementRequestsExistForShard(rb._facetInfo, shardNum)) {
- enqueuePivotFacetShardRequests(null, rb, shardNum);
+ enqueuePivotFacetShardRequests(rb, shardNum);
}
}
}
@@ -1063,7 +1061,7 @@ public class FacetComponent extends SearchComponent {
for (Entry<String,PivotFacet> entry : rb._facetInfo.pivotFacets) {
String key = entry.getKey();
PivotFacet pivot = entry.getValue();
- List<NamedList<Object>> trimmedPivots = pivot.getTrimmedPivotsAsListOfNamedLists(rb);
+ List<NamedList<Object>> trimmedPivots = pivot.getTrimmedPivotsAsListOfNamedLists();
if (null == trimmedPivots) {
trimmedPivots = Collections.<NamedList<Object>>emptyList();
}
@@ -1360,7 +1358,7 @@ public class FacetComponent extends SearchComponent {
// returns the max possible value this ShardFacetCount could have for this shard
// (assumes the shard did not report a count for this value)
- long maxPossible(ShardFacetCount sfc, int shardNum) {
+ long maxPossible(int shardNum) {
return missingMax[shardNum];
// TODO: could store the last term in the shard to tell if this term
// comes before or after it. If it comes before, we could subtract 1
diff --git a/solr/core/src/java/org/apache/solr/handler/component/PivotFacet.java b/solr/core/src/java/org/apache/solr/handler/component/PivotFacet.java
index 3006a579cfc..4cb73bac9a2 100644
--- a/solr/core/src/java/org/apache/solr/handler/component/PivotFacet.java
+++ b/solr/core/src/java/org/apache/solr/handler/component/PivotFacet.java
@@ -119,7 +119,7 @@ public class PivotFacet extends FacetBase {
* @see PivotFacetField#trim
* @see PivotFacetField#convertToListOfNamedLists
*/
- public List<NamedList<Object>> getTrimmedPivotsAsListOfNamedLists(ResponseBuilder rb) {
+ public List<NamedList<Object>> getTrimmedPivotsAsListOfNamedLists() {
if (null == pivotFacetField) {
// no values in any shard for the top field of this pivot
return Collections.<NamedList<Object>>emptyList();
diff --git a/solr/core/src/java/org/apache/solr/handler/component/PivotFacetField.java b/solr/core/src/java/org/apache/solr/handler/component/PivotFacetField.java
index 6ddd9884a46..a7afe0fe33a 100644
--- a/solr/core/src/java/org/apache/solr/handler/component/PivotFacetField.java
+++ b/solr/core/src/java/org/apache/solr/handler/component/PivotFacetField.java
@@ -259,7 +259,7 @@ public class PivotFacetField {
// (mincount may have excluded from a shard)
FacetParams.FACET_SORT_INDEX.equals(facetFieldSort)
// if we are doing count order, we need to refine if the limit was hit
- // (if it not, the shard doesn't have the value or it would have returned already)
+ // (if not, the shard doesn't have the value or it would have returned already)
|| numberOfValuesContributedByShardWasLimitedByFacetFieldLimit(shard) ) {
pf.addRefinement(shard, value);