Browse Source

added javadocs for builder and cleaned up support for `shard_size` on terms & terms_stats facets

uboness 12 years ago
parent
commit
c29f5afa79

+ 5 - 0
src/main/java/org/elasticsearch/search/facet/terms/TermsFacetBuilder.java

@@ -125,6 +125,11 @@ public class TermsFacetBuilder extends FacetBuilder {
         return this;
     }
 
+    /**
+     * Sets the number of terms that will be returned from each shard. The higher the number the more accurate the results will be. The
+     * shard size cannot be smaller than {@link #size(int) size}, therefore in this case it will fall back and be treated as being equal to
+     * size.
+     */
     public TermsFacetBuilder shardSize(int shardSize) {
         this.shardSize = shardSize;
         return this;

+ 1 - 1
src/main/java/org/elasticsearch/search/facet/terms/TermsFacetParser.java

@@ -146,7 +146,7 @@ public class TermsFacetParser extends AbstractComponent implements FacetParser {
         }
 
         if ("_index".equals(field)) {
-            return new IndexNameFacetExecutor(context.shardTarget().index(), comparatorType, size, shardSize);
+            return new IndexNameFacetExecutor(context.shardTarget().index(), comparatorType, size);
         }
 
         if (fieldsNames != null && fieldsNames.length == 1) {

+ 1 - 3
src/main/java/org/elasticsearch/search/facet/terms/index/IndexNameFacetExecutor.java

@@ -36,15 +36,13 @@ public class IndexNameFacetExecutor extends FacetExecutor {
     private final String indexName;
     private final InternalStringTermsFacet.ComparatorType comparatorType;
     private final int size;
-    private final int shardSize;
 
     private int count = 0;
 
-    public IndexNameFacetExecutor(String indexName, TermsFacet.ComparatorType comparatorType, int size, int shardSize) {
+    public IndexNameFacetExecutor(String indexName, TermsFacet.ComparatorType comparatorType, int size) {
         this.indexName = indexName;
         this.comparatorType = comparatorType;
         this.size = size;
-        this.shardSize = shardSize;
     }
 
     @Override