reuse constants for facet type

This commit is contained in:
kimchy 2010-08-02 22:27:03 +03:00
parent dc6ef326d9
commit 07ab5dcf9b
3 changed files with 3 additions and 3 deletions

View File

@ -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());

View File

@ -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());

View File

@ -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) {