From 16a046f686c26309ee0041df8987a4d2ffedd956 Mon Sep 17 00:00:00 2001 From: kimchy Date: Thu, 7 Apr 2011 14:30:12 +0300 Subject: [PATCH] rename termsstats java facet builder to termsStatsFacet --- .../search/facet/FacetBuilders.java | 2 +- .../search/facet/SimpleFacetsTests.java | 34 +++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/search/facet/FacetBuilders.java b/modules/elasticsearch/src/main/java/org/elasticsearch/search/facet/FacetBuilders.java index 24265b7328f..946edd98711 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/search/facet/FacetBuilders.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/search/facet/FacetBuilders.java @@ -59,7 +59,7 @@ public class FacetBuilders { return new TermsFacetBuilder(facetName); } - public static TermsStatsFacetBuilder termsStats(String facetName) { + public static TermsStatsFacetBuilder termsStatsFacet(String facetName) { return new TermsStatsFacetBuilder(facetName); } diff --git a/modules/test/integration/src/test/java/org/elasticsearch/test/integration/search/facet/SimpleFacetsTests.java b/modules/test/integration/src/test/java/org/elasticsearch/test/integration/search/facet/SimpleFacetsTests.java index 87c8bad9457..db5e10708d4 100644 --- a/modules/test/integration/src/test/java/org/elasticsearch/test/integration/search/facet/SimpleFacetsTests.java +++ b/modules/test/integration/src/test/java/org/elasticsearch/test/integration/search/facet/SimpleFacetsTests.java @@ -1460,21 +1460,21 @@ public class SimpleFacetsTests extends AbstractNodesTests { for (int i = 0; i < numberOfRuns(); i++) { SearchResponse searchResponse = client.prepareSearch() .setQuery(matchAllQuery()) - .addFacet(termsStats("stats1").keyField("field").valueField("num")) - .addFacet(termsStats("stats2").keyField("field").valueField("multi_num")) - .addFacet(termsStats("stats3").keyField("field").valueField("num").order(TermsStatsFacet.ComparatorType.COUNT)) - .addFacet(termsStats("stats4").keyField("field").valueField("multi_num").order(TermsStatsFacet.ComparatorType.COUNT)) - .addFacet(termsStats("stats5").keyField("field").valueField("num").order(TermsStatsFacet.ComparatorType.TOTAL)) - .addFacet(termsStats("stats6").keyField("field").valueField("multi_num").order(TermsStatsFacet.ComparatorType.TOTAL)) + .addFacet(termsStatsFacet("stats1").keyField("field").valueField("num")) + .addFacet(termsStatsFacet("stats2").keyField("field").valueField("multi_num")) + .addFacet(termsStatsFacet("stats3").keyField("field").valueField("num").order(TermsStatsFacet.ComparatorType.COUNT)) + .addFacet(termsStatsFacet("stats4").keyField("field").valueField("multi_num").order(TermsStatsFacet.ComparatorType.COUNT)) + .addFacet(termsStatsFacet("stats5").keyField("field").valueField("num").order(TermsStatsFacet.ComparatorType.TOTAL)) + .addFacet(termsStatsFacet("stats6").keyField("field").valueField("multi_num").order(TermsStatsFacet.ComparatorType.TOTAL)) - .addFacet(termsStats("stats7").keyField("field").valueField("num").allTerms()) - .addFacet(termsStats("stats8").keyField("field").valueField("multi_num").allTerms()) - .addFacet(termsStats("stats9").keyField("field").valueField("num").order(TermsStatsFacet.ComparatorType.COUNT).allTerms()) - .addFacet(termsStats("stats10").keyField("field").valueField("multi_num").order(TermsStatsFacet.ComparatorType.COUNT).allTerms()) - .addFacet(termsStats("stats11").keyField("field").valueField("num").order(TermsStatsFacet.ComparatorType.TOTAL).allTerms()) - .addFacet(termsStats("stats12").keyField("field").valueField("multi_num").order(TermsStatsFacet.ComparatorType.TOTAL).allTerms()) + .addFacet(termsStatsFacet("stats7").keyField("field").valueField("num").allTerms()) + .addFacet(termsStatsFacet("stats8").keyField("field").valueField("multi_num").allTerms()) + .addFacet(termsStatsFacet("stats9").keyField("field").valueField("num").order(TermsStatsFacet.ComparatorType.COUNT).allTerms()) + .addFacet(termsStatsFacet("stats10").keyField("field").valueField("multi_num").order(TermsStatsFacet.ComparatorType.COUNT).allTerms()) + .addFacet(termsStatsFacet("stats11").keyField("field").valueField("num").order(TermsStatsFacet.ComparatorType.TOTAL).allTerms()) + .addFacet(termsStatsFacet("stats12").keyField("field").valueField("multi_num").order(TermsStatsFacet.ComparatorType.TOTAL).allTerms()) - .addFacet(termsStats("stats13").keyField("field").valueScript("doc['num'].value * 2")) + .addFacet(termsStatsFacet("stats13").keyField("field").valueScript("doc['num'].value * 2")) .execute().actionGet(); if (searchResponse.failedShards() > 0) { @@ -1646,8 +1646,8 @@ public class SimpleFacetsTests extends AbstractNodesTests { for (int i = 0; i < numberOfRuns(); i++) { SearchResponse searchResponse = client.prepareSearch() .setQuery(matchAllQuery()) - .addFacet(termsStats("stats1").keyField("lField").valueField("num")) - .addFacet(termsStats("stats2").keyField("dField").valueField("num")) + .addFacet(termsStatsFacet("stats1").keyField("lField").valueField("num")) + .addFacet(termsStatsFacet("stats2").keyField("dField").valueField("num")) .execute().actionGet(); if (searchResponse.failedShards() > 0) { @@ -1703,8 +1703,8 @@ public class SimpleFacetsTests extends AbstractNodesTests { for (int i = 0; i < numberOfRuns(); i++) { SearchResponse searchResponse = client.prepareSearch() .setQuery(matchAllQuery()) - .addFacet(termsStats("stats1").keyField("num").valueScript("doc.score").order(TermsStatsFacet.ComparatorType.COUNT)) - .addFacet(termsStats("stats2").keyField("num").valueScript("doc.score").order(TermsStatsFacet.ComparatorType.TOTAL)) + .addFacet(termsStatsFacet("stats1").keyField("num").valueScript("doc.score").order(TermsStatsFacet.ComparatorType.COUNT)) + .addFacet(termsStatsFacet("stats2").keyField("num").valueScript("doc.score").order(TermsStatsFacet.ComparatorType.TOTAL)) .execute().actionGet(); if (searchResponse.failedShards() > 0) {