reuse constants for facet type
This commit is contained in:
parent
dc6ef326d9
commit
07ab5dcf9b
|
@ -176,7 +176,7 @@ public class InternalHistogramFacet implements HistogramFacet, InternalFacet {
|
|||
|
||||
@Override public void toXContent(XContentBuilder builder, Params params) throws IOException {
|
||||
builder.startObject(name);
|
||||
builder.field("_type", "histogram");
|
||||
builder.field("_type", HistogramFacetCollectorParser.NAME);
|
||||
builder.field("_key_field", keyFieldName);
|
||||
builder.field("_value_field", valueFieldName);
|
||||
builder.field("_comparator", comparatorType.description());
|
||||
|
|
|
@ -175,7 +175,7 @@ public class InternalStatisticalFacet implements StatisticalFacet, InternalFacet
|
|||
|
||||
@Override public void toXContent(XContentBuilder builder, Params params) throws IOException {
|
||||
builder.startObject(name);
|
||||
builder.field("_type", "statistical");
|
||||
builder.field("_type", StatisticalFacetCollectorParser.NAME);
|
||||
builder.field("_field", fieldName);
|
||||
builder.field("count", count());
|
||||
builder.field("total", total());
|
||||
|
|
|
@ -132,7 +132,7 @@ public class InternalTermsFacet implements InternalFacet, TermsFacet {
|
|||
|
||||
@Override public void toXContent(XContentBuilder builder, Params params) throws IOException {
|
||||
builder.startObject(name);
|
||||
builder.field("_type", "terms");
|
||||
builder.field("_type", TermsFacetCollectorParser.NAME);
|
||||
builder.field("_field", fieldName);
|
||||
builder.startArray("terms");
|
||||
for (Entry entry : entries) {
|
||||
|
|
Loading…
Reference in New Issue