don't over-request for facet.sort=lex

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@724087 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2008-12-07 06:06:39 +00:00
parent 8f184caf79
commit ccc4189bca
1 changed files with 4 additions and 4 deletions

View File

@ -122,7 +122,7 @@ public class FacetComponent extends SearchComponent
} }
refine.purpose |= ShardRequest.PURPOSE_REFINE_FACETS; refine.purpose |= ShardRequest.PURPOSE_REFINE_FACETS;
refine.params.set(FacetParams.FACET,FacetParams.FACET_SORT_COUNT_LEGACY); refine.params.set(FacetParams.FACET, "true");
refine.params.remove(FacetParams.FACET_FIELD); refine.params.remove(FacetParams.FACET_FIELD);
// TODO: perhaps create a more compact facet.terms method? // TODO: perhaps create a more compact facet.terms method?
refine.params.set(FacetParams.FACET_QUERY, fqueries.toArray(new String[fqueries.size()])); refine.params.set(FacetParams.FACET_QUERY, fqueries.toArray(new String[fqueries.size()]));
@ -160,8 +160,8 @@ public class FacetComponent extends SearchComponent
sreq.params.remove(paramStart + FacetParams.FACET_MINCOUNT); sreq.params.remove(paramStart + FacetParams.FACET_MINCOUNT);
sreq.params.remove(paramStart + FacetParams.FACET_OFFSET); sreq.params.remove(paramStart + FacetParams.FACET_OFFSET);
if(dff.limit > 0) { if(dff.sort.equals(FacetParams.FACET_SORT_COUNT) && dff.limit > 0) {
// set the initial limit higher in increase accuracy // set the initial limit higher to increase accuracy
dff.initialLimit = dff.offset + dff.limit; dff.initialLimit = dff.offset + dff.limit;
dff.initialLimit = (int)(dff.initialLimit * 1.5) + 10; dff.initialLimit = (int)(dff.initialLimit * 1.5) + 10;
} else { } else {
@ -176,7 +176,7 @@ public class FacetComponent extends SearchComponent
} }
} else { } else {
// turn off faceting on other requests // turn off faceting on other requests
sreq.params.set(FacetParams.FACET, FacetParams.FACET_SORT_LEX_LEGACY); sreq.params.set(FacetParams.FACET, "false");
// we could optionally remove faceting params // we could optionally remove faceting params
} }
} }