mirror of https://github.com/apache/lucene.git
SOLR-7103: Remove unused method params in faceting code
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1659175 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a94083c06b
commit
9ace7e1694
|
@ -147,6 +147,8 @@ Other Changes
|
||||||
* SOLR-7076: In DIH, TikaEntityProcessor should have support for onError=skip
|
* SOLR-7076: In DIH, TikaEntityProcessor should have support for onError=skip
|
||||||
(Noble Paul)
|
(Noble Paul)
|
||||||
|
|
||||||
|
* SOLR-7103: Remove unused method params in faceting code. (shalin)
|
||||||
|
|
||||||
================== 5.0.0 ==================
|
================== 5.0.0 ==================
|
||||||
|
|
||||||
Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.
|
Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.
|
||||||
|
|
|
@ -237,7 +237,7 @@ public class FacetComponent extends SearchComponent {
|
||||||
shardsRefineRequest.params.remove(FacetParams.FACET_PIVOT_MINCOUNT);
|
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;
|
return ResponseBuilder.STAGE_DONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void enqueuePivotFacetShardRequests
|
private void enqueuePivotFacetShardRequests(ResponseBuilder rb, int shardNum) {
|
||||||
(HashMap<String,List<String>> pivotFacetRefinements,
|
|
||||||
ResponseBuilder rb, int shardNum) {
|
|
||||||
|
|
||||||
FacetInfo fi = rb._facetInfo;
|
FacetInfo fi = rb._facetInfo;
|
||||||
|
|
||||||
|
@ -315,7 +313,7 @@ public class FacetComponent extends SearchComponent {
|
||||||
|
|
||||||
modifyRequestForFieldFacets(rb, sreq, fi);
|
modifyRequestForFieldFacets(rb, sreq, fi);
|
||||||
|
|
||||||
modifyRequestForRangeFacets(sreq, fi);
|
modifyRequestForRangeFacets(sreq);
|
||||||
|
|
||||||
modifyRequestForPivotFacets(rb, sreq, fi.pivotFacets);
|
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
|
// 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.
|
// Collect all the range fields.
|
||||||
final String[] fields = sreq.params.getParams(FacetParams.FACET_RANGE);
|
final String[] fields = sreq.params.getParams(FacetParams.FACET_RANGE);
|
||||||
if (fields != null) {
|
if (fields != null) {
|
||||||
|
@ -596,7 +594,7 @@ public class FacetComponent extends SearchComponent {
|
||||||
// fbs can be null if a shard request failed
|
// fbs can be null if a shard request failed
|
||||||
if (fbs != null && (sfc.termNum >= fbs.length() || !fbs.get(sfc.termNum))) {
|
if (fbs != null && (sfc.termNum >= fbs.length() || !fbs.get(sfc.termNum))) {
|
||||||
// if missing from this shard, add the max it could be
|
// if missing from this shard, add the max it could be
|
||||||
maxCount += dff.maxPossible(sfc, shardNum);
|
maxCount += dff.maxPossible(shardNum);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (maxCount >= smallestCount) {
|
if (maxCount >= smallestCount) {
|
||||||
|
@ -612,7 +610,7 @@ public class FacetComponent extends SearchComponent {
|
||||||
// fbs can be null if a shard request failed
|
// fbs can be null if a shard request failed
|
||||||
if (fbs != null &&
|
if (fbs != null &&
|
||||||
(sfc.termNum >= fbs.length() || !fbs.get(sfc.termNum)) &&
|
(sfc.termNum >= fbs.length() || !fbs.get(sfc.termNum)) &&
|
||||||
dff.maxPossible(sfc, shardNum) > 0) {
|
dff.maxPossible(shardNum) > 0) {
|
||||||
|
|
||||||
dff.needRefinements = true;
|
dff.needRefinements = true;
|
||||||
List<String> lst = dff._toRefine[shardNum];
|
List<String> lst = dff._toRefine[shardNum];
|
||||||
|
@ -965,7 +963,7 @@ public class FacetComponent extends SearchComponent {
|
||||||
private void reQueuePivotFacetShardRequests(ResponseBuilder rb) {
|
private void reQueuePivotFacetShardRequests(ResponseBuilder rb) {
|
||||||
for (int shardNum = 0; shardNum < rb.shards.length; shardNum++) {
|
for (int shardNum = 0; shardNum < rb.shards.length; shardNum++) {
|
||||||
if (doAnyPivotFacetRefinementRequestsExistForShard(rb._facetInfo, 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) {
|
for (Entry<String,PivotFacet> entry : rb._facetInfo.pivotFacets) {
|
||||||
String key = entry.getKey();
|
String key = entry.getKey();
|
||||||
PivotFacet pivot = entry.getValue();
|
PivotFacet pivot = entry.getValue();
|
||||||
List<NamedList<Object>> trimmedPivots = pivot.getTrimmedPivotsAsListOfNamedLists(rb);
|
List<NamedList<Object>> trimmedPivots = pivot.getTrimmedPivotsAsListOfNamedLists();
|
||||||
if (null == trimmedPivots) {
|
if (null == trimmedPivots) {
|
||||||
trimmedPivots = Collections.<NamedList<Object>>emptyList();
|
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
|
// returns the max possible value this ShardFacetCount could have for this shard
|
||||||
// (assumes the shard did not report a count for this value)
|
// (assumes the shard did not report a count for this value)
|
||||||
long maxPossible(ShardFacetCount sfc, int shardNum) {
|
long maxPossible(int shardNum) {
|
||||||
return missingMax[shardNum];
|
return missingMax[shardNum];
|
||||||
// TODO: could store the last term in the shard to tell if this term
|
// 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
|
// comes before or after it. If it comes before, we could subtract 1
|
||||||
|
|
|
@ -119,7 +119,7 @@ public class PivotFacet extends FacetBase {
|
||||||
* @see PivotFacetField#trim
|
* @see PivotFacetField#trim
|
||||||
* @see PivotFacetField#convertToListOfNamedLists
|
* @see PivotFacetField#convertToListOfNamedLists
|
||||||
*/
|
*/
|
||||||
public List<NamedList<Object>> getTrimmedPivotsAsListOfNamedLists(ResponseBuilder rb) {
|
public List<NamedList<Object>> getTrimmedPivotsAsListOfNamedLists() {
|
||||||
if (null == pivotFacetField) {
|
if (null == pivotFacetField) {
|
||||||
// no values in any shard for the top field of this pivot
|
// no values in any shard for the top field of this pivot
|
||||||
return Collections.<NamedList<Object>>emptyList();
|
return Collections.<NamedList<Object>>emptyList();
|
||||||
|
|
|
@ -259,7 +259,7 @@ public class PivotFacetField {
|
||||||
// (mincount may have excluded from a shard)
|
// (mincount may have excluded from a shard)
|
||||||
FacetParams.FACET_SORT_INDEX.equals(facetFieldSort)
|
FacetParams.FACET_SORT_INDEX.equals(facetFieldSort)
|
||||||
// if we are doing count order, we need to refine if the limit was hit
|
// 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) ) {
|
|| numberOfValuesContributedByShardWasLimitedByFacetFieldLimit(shard) ) {
|
||||||
|
|
||||||
pf.addRefinement(shard, value);
|
pf.addRefinement(shard, value);
|
||||||
|
|
Loading…
Reference in New Issue