Writeable
, ToXContent
, ToXContentObject
public class SliceBuilder extends java.lang.Object implements Writeable, ToXContentObject
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.ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Writeable.Reader<V>, Writeable.Writer<V>
Modifier and Type | Field | Description |
---|---|---|
static ParseField |
FIELD_FIELD |
|
static ParseField |
ID_FIELD |
|
static ParseField |
MAX_FIELD |
EMPTY_PARAMS
Constructor | Description |
---|---|
SliceBuilder(int id,
int max) |
|
SliceBuilder(java.lang.String field,
int id,
int max) |
|
SliceBuilder(StreamInput in) |
Modifier and Type | Method | Description |
---|---|---|
boolean |
equals(java.lang.Object other) |
|
static SliceBuilder |
fromXContent(XContentParser parser) |
|
java.lang.String |
getField() |
The name of the field to slice against
|
int |
getId() |
The id of the slice.
|
int |
getMax() |
The maximum number of slices.
|
int |
hashCode() |
|
org.apache.lucene.search.Query |
toFilter(QueryShardContext context,
int shardId,
int numShards) |
|
java.lang.String |
toString() |
|
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
|
void |
writeTo(StreamOutput out) |
Write this into the StreamOutput.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
isFragment
public static final ParseField FIELD_FIELD
public static final ParseField ID_FIELD
public static final ParseField MAX_FIELD
public SliceBuilder(int id, int max)
public SliceBuilder(java.lang.String field, int id, int max)
field
- The name of the fieldid
- The id of the slicemax
- The maximum number of slicespublic SliceBuilder(StreamInput in) throws java.io.IOException
java.io.IOException
public void writeTo(StreamOutput out) throws java.io.IOException
Writeable
public java.lang.String getField()
public int getId()
public int getMax()
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
toXContent
in interface ToXContent
java.io.IOException
public static SliceBuilder fromXContent(XContentParser parser) throws java.io.IOException
java.io.IOException
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public org.apache.lucene.search.Query toFilter(QueryShardContext context, int shardId, int numShards)
public java.lang.String toString()
toString
in class java.lang.Object