lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject [01/59] [abbrv] lucene-solr:jira/solr-10878: SOLR-10123: Upgraded the Analytics Component to version 2.0
Date Mon, 03 Jul 2017 09:36:41 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/jira/solr-10878 55d24b0eb -> fb7a5397c


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d5963beb/solr/contrib/analytics/src/test/org/apache/solr/analytics/facet/FieldFacetExtrasCloudTest.java
----------------------------------------------------------------------
diff --git a/solr/contrib/analytics/src/test/org/apache/solr/analytics/facet/FieldFacetExtrasCloudTest.java b/solr/contrib/analytics/src/test/org/apache/solr/analytics/facet/FieldFacetExtrasCloudTest.java
new file mode 100644
index 0000000..427b50d
--- /dev/null
+++ b/solr/contrib/analytics/src/test/org/apache/solr/analytics/facet/FieldFacetExtrasCloudTest.java
@@ -0,0 +1,253 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.solr.analytics.facet;
+
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.solr.client.solrj.request.UpdateRequest;
+import org.apache.solr.common.util.NamedList;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class FieldFacetExtrasCloudTest extends AbstractAnalyticsFacetCloudTest {
+  public static final int INT = 21;
+  public static final int LONG = 22;
+  public static final int FLOAT = 23;
+  public static final int DOUBLE = 24;
+  public static final int DATE = 25;
+  public static final int STRING = 26;
+  public static final int NUM_LOOPS = 100;
+  
+  //INT
+  static ArrayList<ArrayList<Integer>> intLongTestStart; 
+  static ArrayList<ArrayList<Integer>> intFloatTestStart; 
+  static ArrayList<ArrayList<Integer>> intDoubleTestStart; 
+  static ArrayList<ArrayList<Integer>> intStringTestStart; 
+  
+  @BeforeClass
+  public static void beforeClass() throws Exception {
+    setupCluster();
+
+    //INT
+    intLongTestStart = new ArrayList<>();
+    intFloatTestStart = new ArrayList<>();
+    intDoubleTestStart = new ArrayList<>();
+    intStringTestStart = new ArrayList<>();
+
+    UpdateRequest req = new UpdateRequest();
+    
+    for (int j = 0; j < NUM_LOOPS; ++j) {
+      int i = j%INT;
+      long l = j%LONG;
+      float f = j%FLOAT;
+      double d = j%DOUBLE;
+      int dt = j%DATE;
+      int s = j%STRING;
+      
+      List<String> fields = new ArrayList<>();
+      fields.add("id"); fields.add("1000"+j);
+      fields.add("int_id"); fields.add("" + i);
+      fields.add("long_ld"); fields.add("" + l);
+      fields.add("float_fd"); fields.add("" + f);
+      fields.add("double_dd"); fields.add("" + d);
+      fields.add("date_dtd"); fields.add((1800+dt) + "-12-31T23:59:59.999Z");
+      fields.add("string_sd"); fields.add("abc" + s);
+      req.add(fields.toArray(new String[0]));
+      
+      //Long
+      if (j-LONG<0) {
+        ArrayList<Integer> list1 = new ArrayList<>();
+        list1.add(i);
+        intLongTestStart.add(list1);
+      } else {
+        intLongTestStart.get((int)l).add(i);
+      }
+      //String
+      if (j-FLOAT<0) {
+        ArrayList<Integer> list1 = new ArrayList<>();
+        list1.add(i);
+        intFloatTestStart.add(list1);
+      } else {
+        intFloatTestStart.get((int)f).add(i);
+      }
+      //String
+      if (j-DOUBLE<0) {
+        ArrayList<Integer> list1 = new ArrayList<>();
+        list1.add(i);
+        intDoubleTestStart.add(list1);
+      } else {
+        intDoubleTestStart.get((int)d).add(i);
+      }
+      //String
+      if (j-STRING<0) {
+        ArrayList<Integer> list1 = new ArrayList<>();
+        list1.add(i);
+        intStringTestStart.add(list1);
+      } else {
+        intStringTestStart.get(s).add(i);
+      }
+    }
+
+    req.commit(cluster.getSolrClient(), COLLECTIONORALIAS);
+  }
+  
+  @Test
+  public void limitTest() throws Exception { 
+    String[] params = new String[] {
+        "o.lr.s.mean", "mean(int_id)",
+        "o.lr.s.median", "median(int_id)",
+        "o.lr.s.count", "count(int_id)",
+        "o.lr.s.percentile_20", "percentile(20,int_id)",
+        "o.lr.ff.long_ld", "long_ld",
+        "o.lr.ff.long_ld.ss", "mean",
+        "o.lr.ff.long_ld.sd", "asc",
+        "o.lr.ff.long_ld.limit", "5",
+        "o.lr.ff.float_fd", "float_fd",
+        "o.lr.ff.float_fd.ss", "median",
+        "o.lr.ff.float_fd.sd", "desc",
+        "o.lr.ff.float_fd.limit", "3",
+        "o.lr.ff.double_dd", "double_dd",
+        "o.lr.ff.double_dd.ss", "count",
+        "o.lr.ff.double_dd.sd", "asc",
+        "o.lr.ff.double_dd.limit", "7",
+        "o.lr.ff.string_sd", "string_sd",
+        "o.lr.ff.string_sd.ss", "percentile_20",
+        "o.lr.ff.string_sd.sd", "desc",
+        "o.lr.ff.string_sd.limit", "1"
+    };
+    
+    NamedList<Object> response = queryCloudAnalytics(params);
+    String responseStr = response.toString();
+
+    Collection<Double> lon = getValueList(response, "lr", "fieldFacets", "long_ld", "mean", false);
+    assertEquals(responseStr, lon.size(),5);
+    Collection<Double> flo = getValueList(response, "lr", "fieldFacets", "float_fd", "median", false);
+    assertEquals(responseStr, flo.size(),3);
+    Collection<Long> doub = getValueList(response, "lr", "fieldFacets", "double_dd", "count", false);
+    assertEquals(responseStr, doub.size(),7);
+    Collection<Integer> string = getValueList(response, "lr", "fieldFacets", "string_sd", "percentile_20", false);
+    assertEquals(responseStr, string.size(),1);
+  }
+  
+  @Test
+  public void offsetTest() throws Exception { 
+    String[] params = new String[] {
+        "o.offAll.s.mean", "mean(int_id)",
+        "o.offAll.ff", "long_ld",
+        "o.offAll.ff.long_ld.ss", "mean",
+        "o.offAll.ff.long_ld.sd", "asc",
+        "o.offAll.ff.long_ld.limit", "7",
+
+        "o.off0.s.mean", "mean(int_id)",
+        "o.off0.ff", "long_ld",
+        "o.off0.ff.long_ld.ss", "mean",
+        "o.off0.ff.long_ld.sd", "asc",
+        "o.off0.ff.long_ld.limit", "2",
+        "o.off0.ff.long_ld.offset", "0",
+
+        "o.off1.s.mean", "mean(int_id)",
+        "o.off1.ff", "long_ld",
+        "o.off1.ff.long_ld.ss", "mean",
+        "o.off1.ff.long_ld.sd", "asc",
+        "o.off1.ff.long_ld.limit", "2",
+        "o.off1.ff.long_ld.offset", "2",
+
+        "o.off2.s.mean", "mean(int_id)",
+        "o.off2.ff", "long_ld",
+        "o.off2.ff.long_ld.ss", "mean",
+        "o.off2.ff.long_ld.sd", "asc",
+        "o.off2.ff.long_ld.limit", "3",
+        "o.off2.ff.long_ld.offset", "4"
+    };
+    
+    NamedList<Object> response = queryCloudAnalytics(params);
+    String responseStr = response.toString();
+
+    Collection<Double> lon;
+   
+    List<Double> all = new ArrayList<>();
+    lon = getValueList(response, "off0", "fieldFacets", "long_ld", "mean", false);
+    assertEquals(responseStr, lon.size(),2);
+    assertArrayEquals(new Double[]{ 1.5,  2.0 }, lon.toArray(new Double[0]));
+    all.addAll(lon);
+    
+    lon = getValueList(response, "off1", "fieldFacets", "long_ld", "mean", false);
+    assertEquals(responseStr, lon.size(),2);
+    assertArrayEquals(new Double[]{ 3.0,  4.0 }, lon.toArray(new Double[0]));
+    all.addAll(lon);
+    
+    lon = getValueList(response, "off2", "fieldFacets", "long_ld", "mean", false);
+    assertEquals(responseStr, lon.size(),3);
+    assertArrayEquals(new Double[]{ 5.0,  5.75, 6.0 }, lon.toArray(new Double[0]));
+    all.addAll(lon);
+    
+    lon = getValueList(response, "offAll", "fieldFacets", "long_ld", "mean", false);
+    assertEquals(responseStr, lon.size(),7);
+    assertArrayEquals(all.toArray(new Double[0]), lon.toArray(new Double[0]));
+  }
+  
+  @SuppressWarnings("unchecked")
+  @Test
+  public void sortTest() throws Exception { 
+    String[] params = new String[] {
+        "o.sr.s.mean", "mean(int_id)",
+        "o.sr.s.median", "median(int_id)",
+        "o.sr.s.count", "count(int_id)",
+        "o.sr.s.percentile_20", "percentile(20,int_id)",
+        "o.sr.ff", "long_ld",
+        "o.sr.ff.long_ld.ss", "mean",
+        "o.sr.ff.long_ld.sd", "asc",
+        "o.sr.ff", "float_fd",
+        "o.sr.ff.float_fd.ss", "median",
+        "o.sr.ff.float_fd.sd", "desc",
+        "o.sr.ff", "double_dd",
+        "o.sr.ff.double_dd.ss", "count",
+        "o.sr.ff.double_dd.sd", "asc",
+        "o.sr.ff", "string_sd",
+        "o.sr.ff.string_sd.ss", "percentile_20",
+        "o.sr.ff.string_sd.sd", "desc"
+    };
+    
+    NamedList<Object> response = queryCloudAnalytics(params);
+    String responseStr = response.toString();
+    
+    Collection<Double> lon = getValueList(response, "sr", "fieldFacets", "long_ld", "mean", false);
+    ArrayList<Double> longTest = calculateNumberStat(intLongTestStart, "mean");
+    Collections.sort(longTest);
+    assertEquals(responseStr, longTest,lon);
+    
+    Collection<Double> flo = getValueList(response, "sr", "fieldFacets", "float_fd", "median", false);
+    ArrayList<Double> floatTest = calculateNumberStat(intFloatTestStart, "median");
+    Collections.sort(floatTest,Collections.reverseOrder());
+    assertEquals(responseStr, floatTest,flo);
+    
+    Collection<Long> doub = getValueList(response, "sr", "fieldFacets", "double_dd", "count", false);
+    ArrayList<Long> doubleTest = (ArrayList<Long>)calculateStat(intDoubleTestStart, "count");
+    Collections.sort(doubleTest);
+    assertEquals(responseStr, doubleTest,doub);
+    
+    Collection<Integer> string = getValueList(response, "sr", "fieldFacets", "string_sd", "percentile_20", false);
+    ArrayList<Integer> stringTest = (ArrayList<Integer>)calculateStat(intStringTestStart, "perc_20");
+    Collections.sort(stringTest,Collections.reverseOrder());
+    assertEquals(responseStr, stringTest,string);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d5963beb/solr/contrib/analytics/src/test/org/apache/solr/analytics/facet/FieldFacetExtrasTest.java
----------------------------------------------------------------------
diff --git a/solr/contrib/analytics/src/test/org/apache/solr/analytics/facet/FieldFacetExtrasTest.java b/solr/contrib/analytics/src/test/org/apache/solr/analytics/facet/FieldFacetExtrasTest.java
index fc7df4b..a7e0012 100644
--- a/solr/contrib/analytics/src/test/org/apache/solr/analytics/facet/FieldFacetExtrasTest.java
+++ b/solr/contrib/analytics/src/test/org/apache/solr/analytics/facet/FieldFacetExtrasTest.java
@@ -26,7 +26,7 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class FieldFacetExtrasTest extends AbstractAnalyticsFacetTest {
-  static String fileName = "/analytics/requestFiles/fieldFacetExtras.txt";
+  static String fileName = "fieldFacetExtras.txt";
 
   public static final int INT = 21;
   public static final int LONG = 22;
@@ -44,7 +44,7 @@ public class FieldFacetExtrasTest extends AbstractAnalyticsFacetTest {
   
   @BeforeClass
   public static void beforeClass() throws Exception {
-    initCore("solrconfig-basic.xml","schema-analytics.xml");
+    initCore("solrconfig-analytics.xml","schema-analytics.xml");
     h.update("<delete><query>*:*</query></delete>");
 
     //INT
@@ -104,7 +104,6 @@ public class FieldFacetExtrasTest extends AbstractAnalyticsFacetTest {
     setResponse(h.query(request(fileToStringArr(FieldFacetExtrasTest.class, fileName))));
   }
   
-  @SuppressWarnings("unchecked")
   @Test
   public void limitTest() throws Exception { 
 
@@ -118,7 +117,6 @@ public class FieldFacetExtrasTest extends AbstractAnalyticsFacetTest {
     assertEquals(getRawResponse(), string.size(),1);
   }
   
-  @SuppressWarnings("unchecked")
   @Test
   public void offsetTest() throws Exception { 
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d5963beb/solr/contrib/analytics/src/test/org/apache/solr/analytics/facet/FieldFacetTest.java
----------------------------------------------------------------------
diff --git a/solr/contrib/analytics/src/test/org/apache/solr/analytics/facet/FieldFacetTest.java b/solr/contrib/analytics/src/test/org/apache/solr/analytics/facet/FieldFacetTest.java
index bf67213..59f4d88 100644
--- a/solr/contrib/analytics/src/test/org/apache/solr/analytics/facet/FieldFacetTest.java
+++ b/solr/contrib/analytics/src/test/org/apache/solr/analytics/facet/FieldFacetTest.java
@@ -24,10 +24,11 @@ import java.util.List;
 import org.junit.Assert;
 import org.junit.BeforeClass;
 import org.junit.Test;
+import org.w3c.dom.Node;
 
 
 public class FieldFacetTest extends AbstractAnalyticsFacetTest{
-  static String fileName = "/analytics/requestFiles/fieldFacets.txt";
+  static String fileName = "fieldFacets.txt";
 
   public static final int INT = 71;
   public static final int LONG = 36;
@@ -87,7 +88,7 @@ public class FieldFacetTest extends AbstractAnalyticsFacetTest{
   
   @BeforeClass
   public static void beforeClass() throws Exception {
-    initCore("solrconfig-basic.xml","schema-analytics.xml");
+    initCore("solrconfig-analytics.xml","schema-analytics.xml");
     h.update("<delete><query>*:*</query></delete>");
     
     defaults.put("int", new Integer(0));
@@ -478,46 +479,6 @@ public class FieldFacetTest extends AbstractAnalyticsFacetTest{
   
   @SuppressWarnings("unchecked")
   @Test
-  public void sumOfSquaresFacetAscTest() throws Exception {
-    //Int Date
-    Collection<Double> intDate = getDoubleList("sumOfSquares","fieldFacets", "date_dtd", "double", "int");
-    ArrayList<Double> intDateTest = calculateNumberStat(intDateTestStart, "sumOfSquares");
-    assertEquals(getRawResponse(),intDate,intDateTest);
-    //Int String
-    Collection<Double> intString = getDoubleList("sumOfSquares","fieldFacets", "string_sd", "double", "int");
-    ArrayList<Double> intStringTest = calculateNumberStat(intStringTestStart, "sumOfSquares");
-    assertEquals(getRawResponse(),intString,intStringTest);
-
-    //Long Date
-    Collection<Double> longDate = getDoubleList("sumOfSquares","fieldFacets", "date_dtd", "double", "long");
-    ArrayList<Double> longDateTest = calculateNumberStat(longDateTestStart, "sumOfSquares");
-    assertEquals(getRawResponse(),longDate,longDateTest);
-    //Long String
-    Collection<Double> longString = getDoubleList("sumOfSquares","fieldFacets", "string_sd", "double", "long");
-    ArrayList<Double> longStringTest = calculateNumberStat(longStringTestStart, "sumOfSquares");
-    assertEquals(getRawResponse(),longString,longStringTest);
-
-    //Float Date
-    Collection<Double> floatDate = getDoubleList("sumOfSquares","fieldFacets", "date_dtd", "double", "float");
-    ArrayList<Double> floatDateTest = calculateNumberStat(floatDateTestStart, "sumOfSquares");
-    assertEquals(getRawResponse(),floatDate,floatDateTest);
-    //Float String
-    Collection<Double> floatString = getDoubleList("sumOfSquares","fieldFacets", "string_sd", "double", "float");
-    ArrayList<Double> floatStringTest = calculateNumberStat(floatStringTestStart, "sumOfSquares");
-    assertEquals(getRawResponse(),floatString,floatStringTest);
-
-    //Double Date
-    Collection<Double> doubleDate = getDoubleList("sumOfSquares","fieldFacets", "date_dtd", "double", "double");
-    ArrayList<Double> doubleDateTest = calculateNumberStat(doubleDateTestStart, "sumOfSquares");
-    assertEquals(getRawResponse(),doubleDate,doubleDateTest);
-    //Double String
-    Collection<Double> doubleString = getDoubleList("sumOfSquares","fieldFacets", "string_sd", "double", "double");
-    ArrayList<Double> doubleStringTest = calculateNumberStat(doubleStringTestStart, "sumOfSquares");
-    assertEquals(getRawResponse(),doubleString,doubleStringTest);
-  }
-  
-  @SuppressWarnings("unchecked")
-  @Test
   public void stddevFacetAscTest() throws Exception { 
     //Int Date
     ArrayList<Double> intDate = getDoubleList("stddev","fieldFacets", "date_dtd", "double", "int");
@@ -1037,31 +998,33 @@ public class FieldFacetTest extends AbstractAnalyticsFacetTest{
   public void missingFacetTest() throws Exception { 
     //int MultiDate
     String xPath = "/response/lst[@name='stats']/lst[@name='missingf']/lst[@name='fieldFacets']/lst[@name='date_dtdm']/lst[@name='(MISSING)']";
-    assertNotNull(getRawResponse(), getNode(xPath));
+    Node missingNodeXPath = getNode(xPath);
+    assertNotNull(getRawResponse(), missingNodeXPath);
 
     ArrayList<Double> string = getDoubleList("missingf", "fieldFacets", "date_dtdm", "double", "mean");
-    string.remove(0);
+    //super.removeNodes(xPath, string);
     ArrayList<Double> stringTest = calculateNumberStat(multiDateTestStart, "mean");
     assertEquals(getRawResponse(), string,stringTest);
-    
+
     //Int String
     xPath = "/response/lst[@name='stats']/lst[@name='missingf']/lst[@name='fieldFacets']/lst[@name='string_sd']/lst[@name='(MISSING)']";
-    assertNotNull(getRawResponse(), getNode(xPath));
+    missingNodeXPath = getNode(xPath);
+    String missingNodeXPathStr = xPath;
+    assertNotNull(getRawResponse(), missingNodeXPath);
 
     xPath = "/response/lst[@name='stats']/lst[@name='missingf']/lst[@name='fieldFacets']/lst[@name='string_sd']/lst[@name='str0']";
     assertNull(getRawResponse(), getNode(xPath));
+
     List<Double> intString = getDoubleList("missingf", "fieldFacets", "string_sd", "double", "mean");
-    intString.remove(0);
+    //removeNodes(missingNodeXPathStr, intString);
     ArrayList<Double> intStringTest = calculateNumberStat(intStringTestStart, "mean");
     assertEquals(getRawResponse(), intString,intStringTest);
-    
+
     //Int Date
     Collection<Double> intDate = getDoubleList("missingf", "fieldFacets", "date_dtd", "double", "mean");
     ArrayList<ArrayList<Double>> intDateMissingTestStart = (ArrayList<ArrayList<Double>>) intDateTestStart.clone();
     ArrayList<Double> intDateTest = calculateNumberStat(intDateMissingTestStart, "mean");
     assertEquals(getRawResponse(),intDate,intDateTest);
-    
-    
   }
 
   private void checkStddevs(ArrayList<Double> list1, ArrayList<Double> list2) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d5963beb/solr/contrib/analytics/src/test/org/apache/solr/analytics/facet/QueryFacetCloudTest.java
----------------------------------------------------------------------
diff --git a/solr/contrib/analytics/src/test/org/apache/solr/analytics/facet/QueryFacetCloudTest.java b/solr/contrib/analytics/src/test/org/apache/solr/analytics/facet/QueryFacetCloudTest.java
new file mode 100644
index 0000000..42b5abe
--- /dev/null
+++ b/solr/contrib/analytics/src/test/org/apache/solr/analytics/facet/QueryFacetCloudTest.java
@@ -0,0 +1,159 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.solr.analytics.facet;
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.solr.client.solrj.request.UpdateRequest;
+import org.apache.solr.common.util.NamedList;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class QueryFacetCloudTest extends AbstractAnalyticsFacetCloudTest {
+  private static final int INT = 71;
+  private static final int LONG = 36;
+  private static final int FLOAT = 93;
+  private static final int DOUBLE = 49;
+  private static final int DATE = 12;
+  private static final int STRING = 7;
+  private static final int NUM_LOOPS = 100;
+  
+  private static ArrayList<ArrayList<Integer>> int1TestStart = new ArrayList<>();
+  private static ArrayList<ArrayList<Integer>> int2TestStart = new ArrayList<>();
+  private static ArrayList<ArrayList<Long>> longTestStart = new ArrayList<>();
+  private static ArrayList<ArrayList<Float>> floatTestStart = new ArrayList<>();
+
+  @BeforeClass
+  public static void beforeClass() throws Exception {
+    setupCluster();
+    
+    //INT
+    int1TestStart.add(new ArrayList<Integer>());
+    int2TestStart.add(new ArrayList<Integer>());
+    
+    //LONG
+    longTestStart.add(new ArrayList<Long>());
+    longTestStart.add(new ArrayList<Long>());
+    
+    //FLOAT
+    floatTestStart.add(new ArrayList<Float>());
+    floatTestStart.add(new ArrayList<Float>());
+    floatTestStart.add(new ArrayList<Float>());
+
+    UpdateRequest req = new UpdateRequest();
+    
+    for (int j = 0; j < NUM_LOOPS; ++j) {
+      int i = j%INT;
+      long l = j%LONG;
+      float f = j%FLOAT;
+      double d = j%DOUBLE;
+      int dt = j%DATE;
+      int s = j%STRING;
+      
+      List<String> fields = new ArrayList<>();
+      fields.add("id"); fields.add("1000"+j);
+      fields.add("int_id"); fields.add("" + i);
+      fields.add("long_ld"); fields.add("" + l);
+      fields.add("float_fd"); fields.add("" + f);
+      fields.add("double_dd"); fields.add("" + d);
+      fields.add("date_dtd"); fields.add((1000+dt) + "-01-01T23:59:59Z");
+      fields.add("string_sd"); fields.add("abc" + s);
+      req.add(fields.toArray(new String[0]));
+      
+      if (f<=50) {
+        int1TestStart.get(0).add(i);
+      }
+      if (f<=30) {
+        int2TestStart.get(0).add(i);
+      }
+      if (s == 1) {
+        longTestStart.get(0).add(l);
+      }
+      if (s == 2) {
+        longTestStart.get(1).add(l);
+      }
+      if (l>=30) {
+        floatTestStart.get(0).add(f);
+      }
+      if (d<=50) {
+        floatTestStart.get(1).add(f);
+      }
+      if (l>=20) {
+        floatTestStart.get(2).add(f);
+      }
+    }
+
+    req.commit(cluster.getSolrClient(), COLLECTIONORALIAS);
+  }
+
+  @SuppressWarnings("unchecked")
+  @Test
+  public void queryTest() throws Exception { 
+    String[] params = new String[] {
+        "o.ir.s.sum", "sum(int_id)",
+        "o.ir.s.mean", "mean(int_id)",
+        "o.ir.s.median", "median(int_id)",
+        "o.ir.s.percentile_8", "percentile(8,int_id)",
+        "o.ir.qf", "float1",
+        "o.ir.qf.float1.q", "float_fd:[* TO 50]",
+        "o.ir.qf", "float2",
+        "o.ir.qf.float2.q", "float_fd:[* TO 30]",
+
+        "o.lr.s.sum", "sum(long_ld)",
+        "o.lr.s.mean", "mean(long_ld)",
+        "o.lr.s.median", "median(long_ld)",
+        "o.lr.s.percentile_8", "percentile(8,long_ld)",
+        "o.lr.qf", "string",
+        "o.lr.qf.string.q", "string_sd:abc1",
+        "o.lr.qf.string.q", "string_sd:abc2",
+        
+        "o.fr.s.sum", "sum(float_fd)",
+        "o.fr.s.mean", "mean(float_fd)",
+        "o.fr.s.median", "median(float_fd)",
+        "o.fr.s.percentile_8", "percentile(8,float_fd)",
+        "o.fr.qf", "lad",
+        "o.fr.qf.lad.q", "long_ld:[20 TO *]",
+        "o.fr.qf.lad.q", "long_ld:[30 TO *]",
+        "o.fr.qf.lad.q", "double_dd:[* TO 50]"
+    };
+    
+    NamedList<Object> response = queryCloudAnalytics(params);
+    String responseStr = response.toString();
+    
+    //Int One
+    ArrayList<Double> int1 = getValueList(response, "ir", "queryFacets", "float1", "sum", false);
+    ArrayList<Double> int1Test = calculateNumberStat(int1TestStart, "sum");
+    assertEquals(responseStr, int1, int1Test);
+    //Int Two
+    ArrayList<Integer> int2 = getValueList(response, "ir", "queryFacets", "float2", "percentile_8", false);
+    ArrayList<Integer> int2Test = (ArrayList<Integer>)calculateStat(int2TestStart, "perc_8");
+    assertEquals(responseStr, int2, int2Test);
+
+    //Long
+    ArrayList<Double> long1 = getValueList(response, "lr", "queryFacets", "string", "median", false);
+    ArrayList<Double> long1Test = calculateNumberStat(longTestStart, "median");
+    assertEquals(responseStr,long1,long1Test);
+
+    //Float
+    ArrayList<Double> float1 = getValueList(response, "fr", "queryFacets", "lad", "mean", false);
+    ArrayList<Double> float1Test = calculateNumberStat(floatTestStart, "mean");
+    assertEquals(responseStr, float1, float1Test);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d5963beb/solr/contrib/analytics/src/test/org/apache/solr/analytics/facet/QueryFacetTest.java
----------------------------------------------------------------------
diff --git a/solr/contrib/analytics/src/test/org/apache/solr/analytics/facet/QueryFacetTest.java b/solr/contrib/analytics/src/test/org/apache/solr/analytics/facet/QueryFacetTest.java
index f62a82b..e892dc9 100644
--- a/solr/contrib/analytics/src/test/org/apache/solr/analytics/facet/QueryFacetTest.java
+++ b/solr/contrib/analytics/src/test/org/apache/solr/analytics/facet/QueryFacetTest.java
@@ -23,7 +23,7 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class QueryFacetTest extends AbstractAnalyticsFacetTest {
-  static String fileName = "/analytics/requestFiles/queryFacets.txt";
+  static String fileName = "queryFacets.txt";
 
   public final int INT = 71;
   public final int LONG = 36;
@@ -35,7 +35,7 @@ public class QueryFacetTest extends AbstractAnalyticsFacetTest {
 
   @BeforeClass
   public static void beforeClass() throws Exception {
-    initCore("solrconfig-basic.xml","schema-analytics.xml");
+    initCore("solrconfig-analytics.xml","schema-analytics.xml");
   }
 
   @SuppressWarnings("unchecked")
@@ -81,13 +81,13 @@ public class QueryFacetTest extends AbstractAnalyticsFacetTest {
       if (new Integer(s).toString().charAt(0)=='2') {
         longTestStart.get(1).add(l);
       }
-      if (l>=20) {
+      if (l>=30) {
         floatTestStart.get(0).add(f);
       }
-      if (l>=30) {
+      if (d<=50) {
         floatTestStart.get(1).add(f);
       }
-      if (d<=50) {
+      if (l>=20) {
         floatTestStart.get(2).add(f);
       }
       

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d5963beb/solr/contrib/analytics/src/test/org/apache/solr/analytics/facet/RangeFacetCloudTest.java
----------------------------------------------------------------------
diff --git a/solr/contrib/analytics/src/test/org/apache/solr/analytics/facet/RangeFacetCloudTest.java b/solr/contrib/analytics/src/test/org/apache/solr/analytics/facet/RangeFacetCloudTest.java
new file mode 100644
index 0000000..880324d
--- /dev/null
+++ b/solr/contrib/analytics/src/test/org/apache/solr/analytics/facet/RangeFacetCloudTest.java
@@ -0,0 +1,588 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.solr.analytics.facet;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.solr.client.solrj.request.UpdateRequest;
+import org.apache.solr.common.util.NamedList;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+
+public class RangeFacetCloudTest extends AbstractAnalyticsFacetCloudTest{
+  public static final int INT = 71;
+  public static final int LONG = 36;
+  public static final int FLOAT = 93;
+  public static final int DOUBLE = 48;
+  public static final int DATE = 52;
+  public static final int STRING = 28;
+  public static final int NUM_LOOPS = 100;
+  
+  //INT
+  static ArrayList<ArrayList<Integer>> intLongTestStart; 
+  static ArrayList<ArrayList<Integer>> intDoubleTestStart; 
+  static ArrayList<ArrayList<Integer>> intDateTestStart; 
+  
+  //FLOAT
+  static ArrayList<ArrayList<Float>> floatLongTestStart; 
+  static ArrayList<ArrayList<Float>> floatDoubleTestStart; 
+  static ArrayList<ArrayList<Float>> floatDateTestStart; 
+  
+  @BeforeClass
+  public static void beforeClass() throws Exception {
+    setupCluster();
+    
+    //INT
+    intLongTestStart = new ArrayList<>();
+    intDoubleTestStart = new ArrayList<>();
+    intDateTestStart = new ArrayList<>();
+    
+    //FLOAT
+    floatLongTestStart = new ArrayList<>();
+    floatDoubleTestStart = new ArrayList<>();
+    floatDateTestStart = new ArrayList<>();
+
+    UpdateRequest req = new UpdateRequest();
+    
+    for (int j = 0; j < NUM_LOOPS; ++j) {
+      int i = j%INT;
+      long l = j%LONG;
+      float f = j%FLOAT;
+      double d = j%DOUBLE;
+      int dt = j%DATE;
+      int s = j%STRING;
+      
+      List<String> fields = new ArrayList<>();
+      fields.add("id"); fields.add("1000"+j);
+      fields.add("int_id"); fields.add("" + i);
+      fields.add("long_ld"); fields.add("" + l);
+      fields.add("float_fd"); fields.add("" + f);
+      fields.add("double_dd"); fields.add("" + d);
+      fields.add("date_dtd"); fields.add((1000+dt) + "-01-01T23:59:59Z");
+      fields.add("string_sd"); fields.add("abc" + s);
+      req.add(fields.toArray(new String[0]));
+      
+      //Longs
+      if (j-LONG<0) {
+        ArrayList<Integer> list1 = new ArrayList<>();
+        list1.add(i);
+        intLongTestStart.add(list1);
+        ArrayList<Float> list2 = new ArrayList<>();
+        list2.add(f);
+        floatLongTestStart.add(list2);
+      } else {
+        intLongTestStart.get((int)l).add(i);
+        floatLongTestStart.get((int)l).add(f);
+      }
+      //Doubles
+      if (j-DOUBLE<0) {
+        ArrayList<Integer> list1 = new ArrayList<>();
+        list1.add(i);
+        intDoubleTestStart.add(list1);
+        ArrayList<Float> list2 = new ArrayList<>();
+        list2.add(f);
+        floatDoubleTestStart.add(list2);
+      } else {
+        intDoubleTestStart.get((int)d).add(i);
+        floatDoubleTestStart.get((int)d).add(f);
+      }
+      //Dates
+      if (j-DATE<0) {
+        ArrayList<Integer> list1 = new ArrayList<>();
+        list1.add(i);
+        intDateTestStart.add(list1);
+        ArrayList<Float> list2 = new ArrayList<>();
+        list2.add(f);
+        floatDateTestStart.add(list2);
+      } else {
+        intDateTestStart.get(dt).add(i);
+        floatDateTestStart.get(dt).add(f);
+      }
+    }
+
+    req.commit(cluster.getSolrClient(), COLLECTIONORALIAS);
+  }
+  
+  @SuppressWarnings("unchecked")
+  @Test
+  public void rangeTest() throws Exception {
+    String[] params = new String[] {
+        "o.ri.s.sum", "sum(int_id)",
+        "o.ri.s.mean", "mean(int_id)",
+        "o.ri.s.median", "median(int_id)",
+        "o.ri.s.count", "count(int_id)",
+        "o.ri.rf", "long_ld",
+        "o.ri.rf.long_ld.st", "5",
+        "o.ri.rf.long_ld.e", "30",
+        "o.ri.rf.long_ld.g", "5",
+        "o.ri.rf.long_ld.ib", "lower",
+        "o.ri.rf.long_ld.or", "all",
+        "o.ri.rf", "double_dd",
+        "o.ri.rf.double_dd.st", "3",
+        "o.ri.rf.double_dd.e", "39",
+        "o.ri.rf.double_dd.g", "7",
+        "o.ri.rf.double_dd.ib", "upper",
+        "o.ri.rf.double_dd.ib", "outer",
+        "o.ri.rf.double_dd.or", "all",
+        "o.ri.rf", "date_dtd",
+        "o.ri.rf.date_dtd.st", "1007-01-01T23:59:59Z",
+        "o.ri.rf.date_dtd.e", "1044-01-01T23:59:59Z",
+        "o.ri.rf.date_dtd.g", "+7YEARS",
+        "o.ri.rf.date_dtd.ib", "lower",
+        "o.ri.rf.date_dtd.ib", "edge",
+        "o.ri.rf.date_dtd.ib", "outer",
+        "o.ri.rf.date_dtd.or", "all",
+
+        "o.rf.s.sum", "sum(float_fd)",
+        "o.rf.s.mean", "mean(float_fd)",
+        "o.rf.s.median", "median(float_fd)",
+        "o.rf.s.count", "count(float_fd)",
+        "o.rf.rf", "long_ld",
+        "o.rf.rf.long_ld.st", "0",
+        "o.rf.rf.long_ld.e", "29",
+        "o.rf.rf.long_ld.g", "4",
+        "o.rf.rf.long_ld.ib", "all",
+        "o.rf.rf.long_ld.or", "all",
+        "o.rf.rf", "double_dd",
+        "o.rf.rf.double_dd.st", "4",
+        "o.rf.rf.double_dd.e", "47",
+        "o.rf.rf.double_dd.g", "11",
+        "o.rf.rf.double_dd.ib", "edge",
+        "o.rf.rf.double_dd.or", "all",
+        "o.rf.rf", "date_dtd",
+        "o.rf.rf.date_dtd.st", "1004-01-01T23:59:59Z",
+        "o.rf.rf.date_dtd.e", "1046-01-01T23:59:59Z",
+        "o.rf.rf.date_dtd.g", "+5YEARS",
+        "o.rf.rf.date_dtd.ib", "upper",
+        "o.rf.rf.date_dtd.ib", "edge",
+        "o.rf.rf.date_dtd.or", "all"
+    };
+    
+    NamedList<Object> response = queryCloudAnalytics(params);
+    String responseStr = response.toString();
+    
+    //Int Long
+    ArrayList<Long> intLong = getValueList(response, "ri", "rangeFacets", "long_ld", "count", false);
+    ArrayList<Long> intLongTest = calculateStat(transformLists(intLongTestStart, 5, 30, 5
+                                                        , false, true, false, false, false), "count");
+    assertEquals(responseStr, intLong,intLongTest);
+    //Int Double
+    ArrayList<Double> intDouble = getValueList(response, "ri", "rangeFacets", "double_dd", "mean", false);
+    ArrayList<Double> intDoubleTest = calculateNumberStat(transformLists(intDoubleTestStart, 3, 39, 7
+                                                          , false, false, true, false, true), "mean");
+    assertEquals(responseStr, intDouble,intDoubleTest);
+    //Int Date
+    ArrayList<Long> intDate = getValueList(response, "ri", "rangeFacets", "date_dtd", "count", false);
+    ArrayList<Long> intDateTest = (ArrayList<Long>)calculateStat(transformLists(intDateTestStart, 7, 44, 7
+                                                      , false, true, false, true, true), "count");
+    assertEquals(responseStr, intDate,intDateTest);
+    
+    //Float Long
+    ArrayList<Double> floatLong = getValueList(response, "rf", "rangeFacets", "long_ld", "median", false);
+    ArrayList<Double> floatLongTest = calculateNumberStat(transformLists(floatLongTestStart, 0, 29, 4
+                                                          , false, true, true, true, true), "median");
+    assertEquals(responseStr, floatLong,floatLongTest);
+    //Float Double
+    ArrayList<Long> floatDouble = getValueList(response, "rf", "rangeFacets", "double_dd", "count", false);
+    ArrayList<Long> floatDoubleTest = (ArrayList<Long>)calculateStat(transformLists(floatDoubleTestStart, 4, 47, 11
+                                                                     , false, false, false, true, false), "count");
+    assertEquals(responseStr, floatDouble,floatDoubleTest);
+  }
+  
+
+  @SuppressWarnings("unchecked")
+  @Test
+  public void hardendRangeTest() throws Exception {
+    String[] params = new String[] {
+        "o.hi.s.sum", "sum(int_id)",
+        "o.hi.s.mean", "mean(int_id)",
+        "o.hi.s.median", "median(int_id)",
+        "o.hi.s.count", "count(int_id)",
+        "o.hi.rf", "long_ld",
+        "o.hi.rf.long_ld.st", "5",
+        "o.hi.rf.long_ld.e", "30",
+        "o.hi.rf.long_ld.g", "5",
+        "o.hi.rf.long_ld.he", "true",
+        "o.hi.rf.long_ld.ib", "lower",
+        "o.hi.rf.long_ld.or", "all",
+        "o.hi.rf", "double_dd",
+        "o.hi.rf.double_dd.st", "3",
+        "o.hi.rf.double_dd.e", "39",
+        "o.hi.rf.double_dd.g", "7",
+        "o.hi.rf.double_dd.he", "true",
+        "o.hi.rf.double_dd.ib", "upper",
+        "o.hi.rf.double_dd.ib", "outer",
+        "o.hi.rf.double_dd.or", "all",
+        "o.hi.rf", "date_dtd",
+        "o.hi.rf.date_dtd.st", "1007-01-01T23:59:59Z",
+        "o.hi.rf.date_dtd.e", "1044-01-01T23:59:59Z",
+        "o.hi.rf.date_dtd.g", "+7YEARS",
+        "o.hi.rf.date_dtd.he", "true",
+        "o.hi.rf.date_dtd.ib", "lower",
+        "o.hi.rf.date_dtd.ib", "edge",
+        "o.hi.rf.date_dtd.ib", "outer",
+        "o.hi.rf.date_dtd.or", "all",
+
+        "o.hf.s.sum", "sum(float_fd)",
+        "o.hf.s.mean", "mean(float_fd)",
+        "o.hf.s.median", "median(float_fd)",
+        "o.hf.s.count", "count(float_fd)",
+        "o.hf.rf", "long_ld",
+        "o.hf.rf.long_ld.st", "0",
+        "o.hf.rf.long_ld.e", "29",
+        "o.hf.rf.long_ld.g", "4",
+        "o.hf.rf.long_ld.he", "true",
+        "o.hf.rf.long_ld.ib", "all",
+        "o.hf.rf.long_ld.or", "all",
+        "o.hf.rf", "double_dd",
+        "o.hf.rf.double_dd.st", "4",
+        "o.hf.rf.double_dd.e", "47",
+        "o.hf.rf.double_dd.g", "11",
+        "o.hf.rf.double_dd.he", "true",
+        "o.hf.rf.double_dd.ib", "edge",
+        "o.hf.rf.double_dd.or", "all",
+        "o.hf.rf", "date_dtd",
+        "o.hf.rf.date_dtd.st", "1004-01-01T23:59:59Z",
+        "o.hf.rf.date_dtd.e", "1046-01-01T23:59:59Z",
+        "o.hf.rf.date_dtd.g", "+5YEARS",
+        "o.hf.rf.date_dtd.he", "true",
+        "o.hf.rf.date_dtd.ib", "upper",
+        "o.hf.rf.date_dtd.ib", "edge",
+        "o.hf.rf.date_dtd.or", "all"
+    };
+    NamedList<Object> response = queryCloudAnalytics(params);
+    String responseStr = response.toString();
+    
+    //Int Long
+    ArrayList<Double> intLong = getValueList(response, "hi", "rangeFacets", "long_ld", "sum", false);
+    ArrayList<Double> intLongTest = calculateNumberStat(transformLists(intLongTestStart, 5, 30, 5
+                                                        , true, true, false, false, false), "sum");
+    assertEquals(responseStr, intLong,intLongTest);
+    //Int Double
+    ArrayList<Double> intDouble = getValueList(response, "hi", "rangeFacets", "double_dd", "mean", false);
+    ArrayList<Double> intDoubleTest = calculateNumberStat(transformLists(intDoubleTestStart, 3, 39, 7
+                                                          , true, false, true, false, true), "mean");
+    assertEquals(responseStr, intDouble,intDoubleTest);
+    //Int Date
+    ArrayList<Long> intDate = getValueList(response, "hi", "rangeFacets", "date_dtd", "count", false);
+    ArrayList<Long> intDateTest = (ArrayList<Long>)calculateStat(transformLists(intDateTestStart, 7, 44, 7
+                                                      , true, true, false, true, true), "count");
+    assertEquals(responseStr, intDate,intDateTest);
+    
+    //Float Long
+    ArrayList<Double> floatLong = getValueList(response, "hf", "rangeFacets", "long_ld", "median", false);
+    ArrayList<Double> floatLongTest = calculateNumberStat(transformLists(floatLongTestStart, 0, 29, 4
+                                                          , true, true, true, true, true), "median");
+    assertEquals(responseStr, floatLong,floatLongTest);
+    //Float Double
+    ArrayList<Long> floatDouble = getValueList(response, "hf", "rangeFacets", "double_dd", "count", false);
+    ArrayList<Long> floatDoubleTest = (ArrayList<Long>)calculateStat(transformLists(floatDoubleTestStart, 4, 47, 11
+                                                                     , true, false, false, true, false), "count");
+    assertEquals(responseStr, floatDouble,floatDoubleTest);
+  }
+  
+  @SuppressWarnings("unchecked")
+  @Test
+  public void multiGapTest() throws Exception {
+    String[] params = new String[] {
+        "o.mi.s.sum", "sum(int_id)",
+        "o.mi.s.mean", "mean(int_id)",
+        "o.mi.s.median", "median(int_id)",
+        "o.mi.s.count", "count(int_id)",
+        "o.mi.rf", "long_ld",
+        "o.mi.rf.long_ld.st", "5",
+        "o.mi.rf.long_ld.e", "30",
+        "o.mi.rf.long_ld.g", "4,2,6,3",
+        "o.mi.rf.long_ld.ib", "lower",
+        "o.mi.rf.long_ld.or", "all",
+        "o.mi.rf", "double_dd",
+        "o.mi.rf.double_dd.st", "3",
+        "o.mi.rf.double_dd.e", "39",
+        "o.mi.rf.double_dd.g", "3,1,7",
+        "o.mi.rf.double_dd.ib", "upper",
+        "o.mi.rf.double_dd.ib", "outer",
+        "o.mi.rf.double_dd.or", "all",
+        "o.mi.rf", "date_dtd",
+        "o.mi.rf.date_dtd.st", "1007-01-01T23:59:59Z",
+        "o.mi.rf.date_dtd.e", "1044-01-01T23:59:59Z",
+        "o.mi.rf.date_dtd.g", "+2YEARS,+7YEARS",
+        "o.mi.rf.date_dtd.ib", "lower",
+        "o.mi.rf.date_dtd.ib", "edge",
+        "o.mi.rf.date_dtd.ib", "outer",
+        "o.mi.rf.date_dtd.or", "all",
+
+        "o.mf.s.sum", "sum(float_fd)",
+        "o.mf.s.mean", "mean(float_fd)",
+        "o.mf.s.median", "median(float_fd)",
+        "o.mf.s.count", "count(float_fd)",
+        "o.mf.rf", "long_ld",
+        "o.mf.rf.long_ld.st", "0",
+        "o.mf.rf.long_ld.e", "29",
+        "o.mf.rf.long_ld.g", "1,4",
+        "o.mf.rf.long_ld.ib", "all",
+        "o.mf.rf.long_ld.or", "all",
+        "o.mf.rf", "double_dd",
+        "o.mf.rf.double_dd.st", "4",
+        "o.mf.rf.double_dd.e", "47",
+        "o.mf.rf.double_dd.g", "2,3,11",
+        "o.mf.rf.double_dd.ib", "edge",
+        "o.mf.rf.double_dd.or", "all",
+        "o.mf.rf", "date_dtd",
+        "o.mf.rf.date_dtd.st", "1004-01-01T23:59:59Z",
+        "o.mf.rf.date_dtd.e", "1046-01-01T23:59:59Z",
+        "o.mf.rf.date_dtd.g", "+4YEARS,+5YEARS",
+        "o.mf.rf.date_dtd.ib", "upper",
+        "o.mf.rf.date_dtd.ib", "edge",
+        "o.mf.rf.date_dtd.or", "all"
+    };
+    NamedList<Object> response = queryCloudAnalytics(params);
+    String responseStr = response.toString();
+    
+    //Int Long
+    ArrayList<Double> intLong = getValueList(response, "mi", "rangeFacets", "long_ld", "sum", false);
+    ArrayList<Double> intLongTest = calculateNumberStat(transformLists(intLongTestStart, 5, 30, "4,2,6,3"
+                                                        , false, true, false, false, false), "sum");
+    assertEquals(responseStr, intLong,intLongTest);
+    //Int Double
+    ArrayList<Double> intDouble = getValueList(response, "mi", "rangeFacets", "double_dd", "mean", false);
+    ArrayList<Double> intDoubleTest = calculateNumberStat(transformLists(intDoubleTestStart, 3, 39, "3,1,7"
+                                                          , false, false, true, false, true), "mean");
+    assertEquals(responseStr, intDouble,intDoubleTest);
+    //Int Date
+    ArrayList<Long> intDate = getValueList(response, "mi", "rangeFacets", "date_dtd", "count", false);
+    ArrayList<Long> intDateTest = (ArrayList<Long>)calculateStat(transformLists(intDateTestStart, 7, 44, "2,7"
+                                                      , false, true, false, true, true), "count");
+    assertEquals(responseStr, intDate,intDateTest);
+    
+    //Float Long
+    ArrayList<Double> floatLong = getValueList(response, "mf", "rangeFacets", "long_ld", "median", false);
+    ArrayList<Double> floatLongTest = calculateNumberStat(transformLists(floatLongTestStart, 0, 29, "1,4"
+                                                          , false, true, true, true, true), "median");;
+    assertEquals(responseStr, floatLong,floatLongTest);
+    //Float Double
+    ArrayList<Long> floatDouble = getValueList(response, "mf", "rangeFacets", "double_dd", "count", false);
+    ArrayList<Long> floatDoubleTest = (ArrayList<Long>)calculateStat(transformLists(floatDoubleTestStart, 4, 47, "2,3,11"
+                                                          , false, false, false, true, false), "count");
+    assertEquals(responseStr, floatDouble,floatDoubleTest);
+  }
+  
+  private <T> ArrayList<ArrayList<T>> transformLists(ArrayList<ArrayList<T>> listsStart, int start, int end, int gap
+      , boolean hardend, boolean incLow, boolean incUp, boolean incEdge, boolean incOut) {
+    int off = (end-start)%gap;
+    if (!hardend && off>0) {
+      end+=gap-off;
+    }
+
+    ArrayList<ArrayList<T>> lists = new ArrayList<>();
+    ArrayList<T> between = new ArrayList<>();
+    if (incLow && incUp) {
+      for (int i = start; i<end && i<listsStart.size(); i+=gap) {
+        ArrayList<T> list = new ArrayList<>();
+        for (int j = i; j<=i+gap && j<=end && j<listsStart.size(); j++) {
+          list.addAll(listsStart.get(j));
+        }
+        lists.add(list);
+      }
+      for (int i = start; i<listsStart.size() && i<=end; i++) {
+        between.addAll(listsStart.get(i));
+      }
+    } else if (incLow && !incUp) {
+      for (int i = start; i<end && i<listsStart.size(); i+=gap) {
+        ArrayList<T> list = new ArrayList<>();
+        for (int j = i; j<i+gap && j<end && j<listsStart.size(); j++) {
+          list.addAll(listsStart.get(j));
+        }
+        lists.add(list);
+      }
+      for (int i = start; i<listsStart.size() && i<end; i++) {
+        between.addAll(listsStart.get(i));
+      }
+    } else if (!incLow && incUp) {
+      for (int i = start; i<end && i<listsStart.size(); i+=gap) {
+        ArrayList<T> list = new ArrayList<>();
+        for (int j = i+1; j<=i+gap && j<=end && j<listsStart.size(); j++) {
+          list.addAll(listsStart.get(j));
+        }
+        lists.add(list);
+      }
+      for (int i = start+1; i<listsStart.size() && i<=end; i++) {
+        between.addAll(listsStart.get(i));
+      }
+    } else {
+      for (int i = start; i<end && i<listsStart.size(); i+=gap) {
+        ArrayList<T> list = new ArrayList<>();
+        for (int j = i+1; j<i+gap && j<end && j<listsStart.size(); j++) {
+          list.addAll(listsStart.get(j));
+        }
+        lists.add(list);
+      }
+      for (int i = start+1; i<listsStart.size() && i<end; i++) {
+        between.addAll(listsStart.get(i));
+      }
+    }
+    
+    if (incEdge && !incLow && start>=0) {
+      lists.get(0).addAll(listsStart.get(start));
+      between.addAll(listsStart.get(start));
+    }
+    if (incEdge && !incUp && end<listsStart.size()) {
+      lists.get(lists.size()-1).addAll(listsStart.get(end));
+      between.addAll(listsStart.get(end));
+    }
+    ArrayList<T> before = new ArrayList<>();
+    ArrayList<T> after = new ArrayList<>();
+    if (incOut || !(incLow||incEdge)) {
+      for (int i = 0; i<=start; i++) {
+        before.addAll(listsStart.get(i));
+      }
+    } else {
+      for (int i = 0; i<start; i++) {
+        before.addAll(listsStart.get(i));
+      }
+    }
+    if (incOut || !(incUp||incEdge)) {
+      for (int i = end; i<listsStart.size(); i++) {
+        after.addAll(listsStart.get(i));
+      }
+    } 
+    else {
+      for (int i = end+1; i<listsStart.size(); i++) {
+        after.addAll(listsStart.get(i));
+      }
+    }
+    lists.add(before);
+    lists.add(after);
+    lists.add(between);
+    return lists;
+  }
+  
+  private <T> ArrayList<ArrayList<T>> transformLists(ArrayList<ArrayList<T>> listsStart, int start, int end, String gapString
+      , boolean hardend, boolean incLow, boolean incUp, boolean incEdge, boolean incOut) {
+    String[] stringGaps = gapString.split(",");
+    int[] gaps = new int[stringGaps.length];
+    for (int i = 0; i<gaps.length; i++) {
+      gaps[i] = Integer.parseInt(stringGaps[i]);
+    }
+    int bigGap = 0;
+    int last = gaps[gaps.length-1];
+    for (int i = 0; i<gaps.length-1; i++) {
+      bigGap += gaps[i];
+    }
+    int off = (end-start-bigGap)%last;
+    if (!hardend && off>0) {
+      end+=last-off;
+    }
+    
+    ArrayList<ArrayList<T>> lists = new ArrayList<>();
+    ArrayList<T> between = new ArrayList<>();
+    int gap = 0;
+    int gapCounter = 0;
+    if (incLow && incUp) {
+      for (int i = start; i<end && i<listsStart.size(); i+=gap) {
+        if (gapCounter<gaps.length) {
+          gap = gaps[gapCounter++];
+        }
+        ArrayList<T> list = new ArrayList<>();
+        for (int j = i; j<=i+gap && j<=end && j<listsStart.size(); j++) {
+          list.addAll(listsStart.get(j));
+        }
+        lists.add(list);
+      }
+      for (int i = start; i<listsStart.size() && i<=end; i++) {
+        between.addAll(listsStart.get(i));
+      }
+    } else if (incLow && !incUp) {
+      for (int i = start; i<end && i<listsStart.size(); i+=gap) {
+        if (gapCounter<gaps.length) {
+          gap = gaps[gapCounter++];
+        }
+        ArrayList<T> list = new ArrayList<>();
+        for (int j = i; j<i+gap && j<end && j<listsStart.size(); j++) {
+          list.addAll(listsStart.get(j));
+        }
+        lists.add(list);
+      }
+      for (int i = start; i<listsStart.size() && i<end; i++) {
+        between.addAll(listsStart.get(i));
+      }
+    } else if (!incLow && incUp) {
+      for (int i = start; i<end && i<listsStart.size(); i+=gap) {
+        if (gapCounter<gaps.length) {
+          gap = gaps[gapCounter++];
+        }
+        ArrayList<T> list = new ArrayList<>();
+        for (int j = i+1; j<=i+gap && j<=end && j<listsStart.size(); j++) {
+          list.addAll(listsStart.get(j));
+        }
+        lists.add(list);
+      }
+      for (int i = start+1; i<listsStart.size() && i<=end; i++) {
+        between.addAll(listsStart.get(i));
+      }
+    } else {
+      for (int i = start; i<end && i<listsStart.size(); i+=gap) {
+        if (gapCounter<gaps.length) {
+          gap = gaps[gapCounter++];
+        }
+        ArrayList<T> list = new ArrayList<>();
+        for (int j = i+1; j<i+gap && j<end && j<listsStart.size(); j++) {
+          list.addAll(listsStart.get(j));
+        }
+        lists.add(list);
+      }
+      for (int i = start+1; i<listsStart.size() && i<end; i++) {
+        between.addAll(listsStart.get(i));
+      }
+    }
+    
+    if (incEdge && !incLow && start>=0) {
+      lists.get(0).addAll(listsStart.get(start));
+      between.addAll(listsStart.get(start));
+    }
+    if (incEdge && !incUp && end<listsStart.size()) {
+      lists.get(lists.size()-1).addAll(listsStart.get(end));
+      between.addAll(listsStart.get(end));
+    }
+    ArrayList<T> before = new ArrayList<>();
+    ArrayList<T> after = new ArrayList<>();
+    if (incOut || !(incLow||incEdge)) {
+      for (int i = 0; i<=start; i++) {
+        before.addAll(listsStart.get(i));
+      }
+    } else {
+      for (int i = 0; i<start; i++) {
+        before.addAll(listsStart.get(i));
+      }
+    }
+    if (incOut || !(incUp||incEdge)) {
+      for (int i = end; i<listsStart.size(); i++) {
+        after.addAll(listsStart.get(i));
+      }
+    } 
+    else {
+      for (int i = end+1; i<listsStart.size(); i++) {
+        after.addAll(listsStart.get(i));
+      }
+    }
+    lists.add(before);
+    lists.add(after);
+    lists.add(between);
+    return lists;
+  }
+}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d5963beb/solr/contrib/analytics/src/test/org/apache/solr/analytics/facet/RangeFacetTest.java
----------------------------------------------------------------------
diff --git a/solr/contrib/analytics/src/test/org/apache/solr/analytics/facet/RangeFacetTest.java b/solr/contrib/analytics/src/test/org/apache/solr/analytics/facet/RangeFacetTest.java
index cda8202..24a7ea2 100644
--- a/solr/contrib/analytics/src/test/org/apache/solr/analytics/facet/RangeFacetTest.java
+++ b/solr/contrib/analytics/src/test/org/apache/solr/analytics/facet/RangeFacetTest.java
@@ -24,7 +24,7 @@ import org.junit.Test;
 
 
 public class RangeFacetTest extends AbstractAnalyticsFacetTest {
-  static String fileName = "/analytics/requestFiles/rangeFacets.txt";
+  static String fileName = "rangeFacets.txt";
 
   public static final int INT = 71;
   public static final int LONG = 36;
@@ -46,7 +46,7 @@ public class RangeFacetTest extends AbstractAnalyticsFacetTest {
   
   @BeforeClass
   public static void beforeClass() throws Exception {
-    initCore("solrconfig-basic.xml","schema-analytics.xml");
+    initCore("solrconfig-analytics.xml","schema-analytics.xml");
     h.update("<delete><query>*:*</query></delete>");
     
     //INT
@@ -145,11 +145,6 @@ public class RangeFacetTest extends AbstractAnalyticsFacetTest {
     ArrayList<Long> floatDoubleTest = (ArrayList<Long>)calculateStat(transformLists(floatDoubleTestStart, 4, 47, 11
                                                                      , false, false, false, true, false), "count");
     assertEquals(getRawResponse(), floatDouble,floatDoubleTest);
-    //Float Date                      
-    ArrayList<Double> floatDate = getDoubleList("rf", "rangeFacets", "date_dtd", "double", "sumOfSquares");
-    ArrayList<Double> floatDateTest = calculateNumberStat(transformLists(floatDateTestStart, 4, 46, 5
-                                                          , false, false, true, true, false), "sumOfSquares");
-    assertEquals(getRawResponse(), floatDate,floatDateTest);
   }
   
 
@@ -182,11 +177,6 @@ public class RangeFacetTest extends AbstractAnalyticsFacetTest {
     ArrayList<Long> floatDoubleTest = (ArrayList<Long>)calculateStat(transformLists(floatDoubleTestStart, 4, 47, 11
                                                                      , true, false, false, true, false), "count");
     assertEquals(getRawResponse(), floatDouble,floatDoubleTest);
-    //Float Date                      
-    ArrayList<Double> floatDate = getDoubleList("hf", "rangeFacets", "date_dtd", "double", "sumOfSquares");
-    ArrayList<Double> floatDateTest = calculateNumberStat(transformLists(floatDateTestStart, 4, 46, 5
-                                                          , true, false, true, true, false), "sumOfSquares");
-    assertEquals(getRawResponse(), floatDate,floatDateTest);
   }
   
   @SuppressWarnings("unchecked")
@@ -218,11 +208,6 @@ public class RangeFacetTest extends AbstractAnalyticsFacetTest {
     ArrayList<Long> floatDoubleTest = (ArrayList<Long>)calculateStat(transformLists(floatDoubleTestStart, 4, 47, "2,3,11"
                                                           , false, false, false, true, false), "count");
     assertEquals(getRawResponse(), floatDouble,floatDoubleTest);
-    //Float Date                      
-    ArrayList<Double> floatDate = getDoubleList("mf", "rangeFacets", "date_dtd", "double", "sumOfSquares");
-    ArrayList<Double> floatDateTest = calculateNumberStat(transformLists(floatDateTestStart, 4, 46, "4,5"
-                                                          , false, false, true, true, false), "sumOfSquares");
-    assertEquals(getRawResponse(), floatDate,floatDateTest);
   }
   
   private <T> ArrayList<ArrayList<T>> transformLists(ArrayList<ArrayList<T>> listsStart, int start, int end, int gap
@@ -309,15 +294,9 @@ public class RangeFacetTest extends AbstractAnalyticsFacetTest {
         after.addAll(listsStart.get(i));
       }
     }
-    if (before.size()>0) {
-      lists.add(before);
-    }
-    if (after.size()>0) {
-      lists.add(after);
-    }
-    if (between.size()>0) {
-      lists.add(between);
-    }
+    lists.add(before);
+    lists.add(after);
+    lists.add(between);
     return lists;
   }
   
@@ -429,15 +408,9 @@ public class RangeFacetTest extends AbstractAnalyticsFacetTest {
         after.addAll(listsStart.get(i));
       }
     }
-    if (before.size()>0) {
-      lists.add(before);
-    }
-    if (after.size()>0) {
-      lists.add(after);
-    }
-    if (between.size()>0) {
-      lists.add(between);
-    }
+    lists.add(before);
+    lists.add(after);
+    lists.add(between);
     return lists;
   }
   

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d5963beb/solr/contrib/analytics/src/test/org/apache/solr/analytics/util/valuesource/FunctionTest.java
----------------------------------------------------------------------
diff --git a/solr/contrib/analytics/src/test/org/apache/solr/analytics/util/valuesource/FunctionTest.java b/solr/contrib/analytics/src/test/org/apache/solr/analytics/util/valuesource/FunctionTest.java
deleted file mode 100644
index 5981cc0..0000000
--- a/solr/contrib/analytics/src/test/org/apache/solr/analytics/util/valuesource/FunctionTest.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.solr.analytics.util.valuesource;
-
-
-import org.apache.solr.analytics.AbstractAnalyticsStatsTest;
-import org.apache.solr.analytics.facet.AbstractAnalyticsFacetTest;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class FunctionTest extends AbstractAnalyticsStatsTest {
-  static String fileName = "/analytics/requestFiles/functions.txt";
-
-  static public final int INT = 71;
-  static public final int LONG = 36;
-  static public final int FLOAT = 93;
-  static public final int DOUBLE = 49;
-  static public final int DATE = 12;
-  static public final int STRING = 28;
-  static public final int NUM_LOOPS = 100;
-
-  @BeforeClass
-  public static void beforeClass() throws Exception {
-    initCore("solrconfig-basic.xml","schema-analytics.xml");
-    h.update("<delete><query>*:*</query></delete>");
-    
-    for (int j = 0; j < NUM_LOOPS; ++j) {
-      int i = j%INT+1;
-      long l = j%LONG+1;
-      float f = j%FLOAT+1;
-      double d = j%DOUBLE+1;
-      double d0 = j%DOUBLE;
-      String dt = (1800+j%DATE) + "-06-30T23:59:59Z";
-      String s = "str" + (j%STRING);
-
-      double add_if = (double)i+f;
-      double add_ldf = (double)l+d+f;
-      double mult_if = (double)i*f;
-      double mult_ldf = (double)l*d*f;
-      double div_if = (double)i/f;
-      double div_ld = (double)l/d;
-      double pow_if = Math.pow(i,f);
-      double pow_ld = Math.pow(l,d);
-      double neg_i = (double)i*-1;
-      double neg_l = (double)l*-1;
-      String dm_2y = (1802+j%DATE) + "-06-30T23:59:59Z";
-      String dm_2m = (1800+j%DATE) + "-08-30T23:59:59Z";
-      String concat_first = "this is the first"+s;
-      String concat_second = "this is the second"+s;
-      String rev = new StringBuilder(s).reverse().toString();
-      
-      assertU(adoc(AbstractAnalyticsFacetTest.filter("id", "1000" + j, "int_id", "" + i, "long_ld", "" + l, "float_fd", "" + f, 
-            "double_dd", "" + d,  "date_dtd", dt, "string_sd", s,
-            "add_if_dd", ""+add_if, "add_ldf_dd", ""+add_ldf, "mult_if_dd", ""+mult_if, "mult_ldf_dd", ""+mult_ldf,
-            "div_if_dd", ""+div_if, "div_ld_dd", ""+div_ld, "pow_if_dd", ""+pow_if, "pow_ld_dd", ""+pow_ld,
-            "neg_i_dd", ""+neg_i, "neg_l_dd", ""+neg_l, "const_8_dd", "8", "const_10_dd", "10", "dm_2y_dtd", dm_2y, "dm_2m_dtd", dm_2m,
-            "const_00_dtd", "1800-06-30T23:59:59Z", "const_04_dtd", "1804-06-30T23:59:59Z", "const_first_sd", "this is the first", "const_second_sd", "this is the second",
-            "concat_first_sd", concat_first, "concat_second_sd", concat_second, "rev_sd", rev, "miss_dd", ""+d0 )));
-      
-      
-      if (usually()) {
-        assertU(commit()); // to have several segments
-      }
-    }
-    
-    assertU(commit()); 
-    
-    setResponse(h.query(request(fileToStringArr(FunctionTest.class, fileName))));
-  }
-      
-  @Test
-  public void addTest() throws Exception { 
-    double result = (Double)getStatResult("ar", "sum", VAL_TYPE.DOUBLE);
-    double calculated = (Double)getStatResult("ar", "sumc", VAL_TYPE.DOUBLE);
-    assertEquals(getRawResponse(), result, calculated, 0.0);
-    // TODO checfk why asserted 2times
-    assertEquals(getRawResponse(), result, calculated, 0.0);
-
-    result = (Double)getStatResult("ar", "mean", VAL_TYPE.DOUBLE);
-    calculated = (Double)getStatResult("ar", "meanc", VAL_TYPE.DOUBLE);
-    assertTrue(result==calculated);
-    assertEquals(getRawResponse(), result, calculated, 0.0);
-  }
-  
-  @Test
-  public void multiplyTest() throws Exception { 
-    double result = (Double)getStatResult("mr", "sum", VAL_TYPE.DOUBLE);
-    double calculated = (Double)getStatResult("mr", "sumc", VAL_TYPE.DOUBLE);
-    assertEquals(getRawResponse(),  result, calculated, 0.0);
-    
-    result = (Double)getStatResult("mr", "mean", VAL_TYPE.DOUBLE);
-    calculated = (Double)getStatResult("mr", "meanc", VAL_TYPE.DOUBLE);
-    assertEquals(getRawResponse(),  result, calculated, 0.0);
-  }
-  
-  @Test
-  public void divideTest() throws Exception { 
-    Double result = (Double)getStatResult("dr", "sum", VAL_TYPE.DOUBLE);
-    Double calculated = (Double)getStatResult("dr", "sumc", VAL_TYPE.DOUBLE);
-    assertEquals(getRawResponse(),  result, calculated, 0.0);
-    
-    result = (Double)getStatResult("dr", "mean", VAL_TYPE.DOUBLE);
-    calculated = (Double)getStatResult("dr", "meanc", VAL_TYPE.DOUBLE);
-    assertEquals(getRawResponse(),  result, calculated, 0.0);
-  }
-  
-  @Test
-  public void powerTest() throws Exception { 
-    double result = (Double)getStatResult("pr", "sum", VAL_TYPE.DOUBLE);
-    double calculated = (Double)getStatResult("pr", "sumc", VAL_TYPE.DOUBLE);
-    assertEquals(getRawResponse(), result, calculated, 0.0);
-    assertEquals(getRawResponse(),  result, calculated, 0.0);
-    
-    result = (Double)getStatResult("pr", "mean", VAL_TYPE.DOUBLE);
-    calculated = (Double)getStatResult("pr", "meanc", VAL_TYPE.DOUBLE);
-    assertEquals(getRawResponse(), result, calculated, 0.0);
-    assertEquals(getRawResponse(), result, calculated, 0.0);
-  }
-  
-  @Test
-  public void negateTest() throws Exception { 
-    double result = (Double)getStatResult("nr", "sum", VAL_TYPE.DOUBLE);
-    double calculated = (Double)getStatResult("nr", "sumc", VAL_TYPE.DOUBLE);
-    assertEquals(getRawResponse(),  result, calculated, 0.0);
-    
-    result = (Double)getStatResult("nr", "mean", VAL_TYPE.DOUBLE);
-    calculated = (Double)getStatResult("nr", "meanc", VAL_TYPE.DOUBLE);
-    assertEquals(getRawResponse(),  result, calculated, 0.0);
-  }
-
-  @Test 
-  public void absoluteValueTest() throws Exception {
-    double result = (Double)getStatResult("avr", "sum", VAL_TYPE.DOUBLE);
-    double calculated = (Double)getStatResult("avr", "sumc", VAL_TYPE.DOUBLE);
-    assertEquals(getRawResponse(),  result, calculated, 0.0);
-    
-    result = (Double)getStatResult("avr", "mean", VAL_TYPE.DOUBLE);
-    calculated = (Double)getStatResult("avr", "meanc", VAL_TYPE.DOUBLE);
-    assertEquals(getRawResponse(),  result, calculated, 0.0);
-  }
-  
-  @Test
-  public void constantNumberTest() throws Exception { 
-    double result = (Double)getStatResult("cnr", "sum", VAL_TYPE.DOUBLE);
-    double calculated = (Double)getStatResult("cnr", "sumc", VAL_TYPE.DOUBLE);
-    assertEquals(getRawResponse(), result, calculated, 0.0);
-    assertEquals(getRawResponse(), result, calculated, 0.0);
-    
-    result = (Double)getStatResult("cnr", "mean", VAL_TYPE.DOUBLE);
-    calculated = (Double)getStatResult("cnr", "meanc", VAL_TYPE.DOUBLE);
-    assertEquals(getRawResponse(), result, calculated, 0.0);
-    assertEquals(getRawResponse(),  result, calculated, 0.0);
-  }
-  
-  @Test
-  public void dateMathTest() throws Exception {
-    String result = (String)getStatResult("dmr", "median", VAL_TYPE.DATE);
-    String calculated = (String)getStatResult("dmr", "medianc", VAL_TYPE.DATE);
-    assertEquals(getRawResponse(), result, calculated);
-    
-    result = (String)getStatResult("dmr", "max", VAL_TYPE.DATE);
-    calculated = (String)getStatResult("dmr", "maxc", VAL_TYPE.DATE);
-    assertEquals(getRawResponse(), result, calculated);
-  }
-  
-  @Test
-  public void constantDateTest() throws Exception { 
-    String result = (String)getStatResult("cdr", "median", VAL_TYPE.DATE);
-    String calculated = (String)getStatResult("cdr", "medianc", VAL_TYPE.DATE);
-    assertEquals(getRawResponse(), result, calculated);
-    assertEquals(getRawResponse(), result, calculated);
-    
-    result = (String)getStatResult("cdr", "max", VAL_TYPE.DATE);
-    calculated = (String)getStatResult("cdr", "maxc", VAL_TYPE.DATE);
-    assertEquals(getRawResponse(), result, calculated);
-  }
-  
-  @Test
-  public void constantStringTest() throws Exception { 
-    String result = (String)getStatResult("csr", "min", VAL_TYPE.STRING);
-    String calculated = (String)getStatResult("csr", "minc", VAL_TYPE.STRING);
-    assertEquals(getRawResponse(), result, calculated);
-    
-    result = (String)getStatResult("csr", "max", VAL_TYPE.STRING);
-    calculated = (String)getStatResult("csr", "maxc", VAL_TYPE.STRING);
-    assertEquals(getRawResponse(), result, calculated);
-  }
-  
-  @Test
-  public void concatenateTest() throws Exception { 
-    String result = (String)getStatResult("cr", "min", VAL_TYPE.STRING);
-    String calculated = (String)getStatResult("cr", "minc", VAL_TYPE.STRING);
-    assertEquals(getRawResponse(), result, calculated);
-    
-    result = (String)getStatResult("cr", "max", VAL_TYPE.STRING);
-    calculated = (String)getStatResult("cr", "maxc", VAL_TYPE.STRING);
-    assertEquals(getRawResponse(), result, calculated);
-  }
-  
-  @Test
-  public void reverseTest() throws Exception { 
-    String result = (String)getStatResult("rr", "min", VAL_TYPE.STRING);
-    String calculated = (String)getStatResult("rr", "minc", VAL_TYPE.STRING);
-    assertEquals(getRawResponse(), result, calculated);
-    
-    result = (String)getStatResult("rr", "max", VAL_TYPE.STRING);
-    calculated = (String)getStatResult("rr", "maxc", VAL_TYPE.STRING);
-    assertEquals(getRawResponse(), result, calculated);
-  }
-  
-  @Test
-  public void missingTest() throws Exception { 
-    double min = (Double)getStatResult("ms", "min", VAL_TYPE.DOUBLE);
-    double max = (Double)getStatResult("ms", "max", VAL_TYPE.DOUBLE);
-    assertEquals(getRawResponse(), 48.0d, max, 0.0);
-    assertEquals(getRawResponse(), 1.0d, min, 0.0);
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d5963beb/solr/core/src/java/org/apache/solr/handler/component/ResponseBuilder.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/component/ResponseBuilder.java b/solr/core/src/java/org/apache/solr/handler/component/ResponseBuilder.java
index e5eaff9..8e9477b 100644
--- a/solr/core/src/java/org/apache/solr/handler/component/ResponseBuilder.java
+++ b/solr/core/src/java/org/apache/solr/handler/component/ResponseBuilder.java
@@ -60,6 +60,7 @@ public class ResponseBuilder
   public boolean doExpand;
   public boolean doStats;
   public boolean doTerms;
+  public boolean doAnalytics;
   public MergeStrategy mergeFieldHandler;
 
   private boolean needDocList = false;
@@ -173,6 +174,8 @@ public class ResponseBuilder
   StatsInfo _statsInfo;
   TermsComponent.TermsHelper _termsHelper;
   SimpleOrderedMap<List<NamedList<Object>>> _pivots;
+  Object _analyticsRequestManager;
+  boolean _isOlapAnalytics;
 
   // Context fields for grouping
   public final Map<String, Collection<SearchGroup<BytesRef>>> mergedSearchGroups = new HashMap<>();


Mime
View raw message