Class SliceBuilder

java.lang.Object
org.elasticsearch.search.slice.SliceBuilder
All Implemented Interfaces:
Writeable, ToXContent, ToXContentObject

public class SliceBuilder extends Object implements Writeable, ToXContentObject
A slice builder allowing to split a scroll in multiple partitions. If the provided field is the "_uid" it uses a TermsSliceQuery to do the slicing. The slicing is done at the shard level first and then each shard is split into multiple slices. For instance if the number of shards is equal to 2 and the user requested 4 slices then the slices 0 and 2 are assigned to the first shard and the slices 1 and 3 are assigned to the second shard. This way the total number of bitsets that we need to build on each shard is bounded by the number of slices (instead of numShards*numSlices). Otherwise the provided field must be a numeric and doc_values must be enabled. In that case a DocValuesSliceQuery is used to filter the results.
  • Field Details

    • FIELD_FIELD

      public static final ParseField FIELD_FIELD
    • ID_FIELD

      public static final ParseField ID_FIELD
    • MAX_FIELD

      public static final ParseField MAX_FIELD
  • Constructor Details

    • SliceBuilder

      public SliceBuilder(int id, int max)
      Build a slice using the default strategy.
      Parameters:
      id - The id of the slice
      max - The maximum number of slices
    • SliceBuilder

      public SliceBuilder(String field, int id, int max)
      Build a slice on a particular field.
      Parameters:
      field - The name of the field to slice against
      id - The id of the slice
      max - The maximum number of slices
    • SliceBuilder

      public SliceBuilder(StreamInput in) throws IOException
      Throws:
      IOException
  • Method Details