Package org.springframework.data.solr.core.query.result

Examples of org.springframework.data.solr.core.query.result.StatsResult


    Assert.assertEquals(Double.valueOf(520.25), priceStats.getSumOfSquares());

    Map<String, StatsResult> facetStatsResult = priceStats.getFacetStatsResult(new SimpleField("name"));
    Assert.assertEquals(2, facetStatsResult.size());
    {
      StatsResult nameFacetStatsResult = facetStatsResult.get("one");
      Assert.assertEquals(Long.valueOf(1), nameFacetStatsResult.getCount());
      Assert.assertEquals(10D, nameFacetStatsResult.getMin());
      Assert.assertEquals(10D, nameFacetStatsResult.getMax());
    }
    {
      StatsResult nameFacetStatsResult = facetStatsResult.get("two");
      Assert.assertEquals(Long.valueOf(1), nameFacetStatsResult.getCount());
      Assert.assertEquals(20.5D, nameFacetStatsResult.getMin());
      Assert.assertEquals(20.5D, nameFacetStatsResult.getMax());
    }
  }
View Full Code Here


    // facet field
    Map<String, StatsResult> facetStatsResult = facetStatsResults.get("facetField");
    Assert.assertNotNull(facetStatsResult);

    // facet values
    StatsResult facetValue1StatsResult = facetStatsResult.get("value1");
    Assert.assertEquals("f1v1min", facetValue1StatsResult.getMin());
    Assert.assertEquals("f1v1max", facetValue1StatsResult.getMax());
    Assert.assertEquals(Double.valueOf(110), facetValue1StatsResult.getSum());
    Assert.assertEquals(Double.valueOf(113), facetValue1StatsResult.getMean());
    Assert.assertEquals(Long.valueOf(111), facetValue1StatsResult.getCount());
    Assert.assertEquals(Long.valueOf(112), facetValue1StatsResult.getMissing());
    Assert.assertEquals(Double.valueOf(11.3), facetValue1StatsResult.getStddev());

    StatsResult facetValue2StatsResult = facetStatsResult.get("value2");
    Assert.assertEquals("f1v2min", facetValue2StatsResult.getMin());
    Assert.assertEquals("f1v2max", facetValue2StatsResult.getMax());
    Assert.assertEquals(Double.valueOf(120), facetValue2StatsResult.getSum());
    Assert.assertEquals(Double.valueOf(123), facetValue2StatsResult.getMean());
    Assert.assertEquals(Long.valueOf(121), facetValue2StatsResult.getCount());
    Assert.assertEquals(Long.valueOf(122), facetValue2StatsResult.getMissing());
    Assert.assertEquals(Double.valueOf(12.3), facetValue2StatsResult.getStddev());
  }
View Full Code Here

TOP

Related Classes of org.springframework.data.solr.core.query.result.StatsResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.