From 07ab5dcf9b4180f66fa89ea3539a429dcde18833 Mon Sep 17 00:00:00 2001 From: kimchy Date: Mon, 2 Aug 2010 22:27:03 +0300 Subject: [PATCH] reuse constants for facet type --- .../search/facets/histogram/InternalHistogramFacet.java | 2 +- .../search/facets/statistical/InternalStatisticalFacet.java | 2 +- .../elasticsearch/search/facets/terms/InternalTermsFacet.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/search/facets/histogram/InternalHistogramFacet.java b/modules/elasticsearch/src/main/java/org/elasticsearch/search/facets/histogram/InternalHistogramFacet.java index e7b8d9b6ea1..ed0a4f3115d 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/search/facets/histogram/InternalHistogramFacet.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/search/facets/histogram/InternalHistogramFacet.java @@ -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()); diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/search/facets/statistical/InternalStatisticalFacet.java b/modules/elasticsearch/src/main/java/org/elasticsearch/search/facets/statistical/InternalStatisticalFacet.java index ba81e5170cb..4d47d6500c0 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/search/facets/statistical/InternalStatisticalFacet.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/search/facets/statistical/InternalStatisticalFacet.java @@ -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()); diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/search/facets/terms/InternalTermsFacet.java b/modules/elasticsearch/src/main/java/org/elasticsearch/search/facets/terms/InternalTermsFacet.java index 53f995c7bfe..dabad1ce73f 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/search/facets/terms/InternalTermsFacet.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/search/facets/terms/InternalTermsFacet.java @@ -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) {