logger.warn("-> {}", shardSearchFailure);
}
}
assertThat(searchResponse.failedShards(), equalTo(0));
RangeFacet facet = searchResponse.facets().facet("range1");
assertThat(facet.name(), equalTo("range1"));
assertThat(facet.entries().size(), equalTo(3));
assertThat(facet.entries().get(0).to(), closeTo(1056, 0.000001));
assertThat(Double.parseDouble(facet.entries().get(0).toAsString()), closeTo(1056, 0.000001));
assertThat(facet.entries().get(0).count(), equalTo(1l));
assertThat(facet.entries().get(0).totalCount(), equalTo(1l));
assertThat(facet.entries().get(0).total(), closeTo(1055, 0.000001));
assertThat(facet.entries().get(0).min(), closeTo(1055, 0.000001));
assertThat(facet.entries().get(0).max(), closeTo(1055, 0.000001));
assertThat(facet.entries().get(1).from(), closeTo(1000, 0.000001));
assertThat(Double.parseDouble(facet.entries().get(1).fromAsString()), closeTo(1000, 0.000001));
assertThat(facet.entries().get(1).to(), closeTo(1170, 0.000001));
assertThat(Double.parseDouble(facet.entries().get(1).toAsString()), closeTo(1170, 0.000001));
assertThat(facet.entries().get(1).count(), equalTo(2l));
assertThat(facet.entries().get(1).totalCount(), equalTo(2l));
assertThat(facet.entries().get(1).total(), closeTo(1055 + 1065, 0.000001));
assertThat(facet.entries().get(1).min(), closeTo(1055, 0.000001));
assertThat(facet.entries().get(1).max(), closeTo(1065, 0.000001));
assertThat(facet.entries().get(2).from(), closeTo(1170, 0.000001));
assertThat(facet.entries().get(2).count(), equalTo(1l));
assertThat(facet.entries().get(2).totalCount(), equalTo(1l));
assertThat(facet.entries().get(2).total(), closeTo(1175, 0.000001));
assertThat(facet.entries().get(2).min(), closeTo(1175, 0.000001));
assertThat(facet.entries().get(2).max(), closeTo(1175, 0.000001));
facet = searchResponse.facets().facet("range2");
assertThat(facet.name(), equalTo("range2"));
assertThat(facet.entries().size(), equalTo(3));
assertThat(facet.entries().get(0).to(), closeTo(1056, 0.000001));
assertThat(facet.entries().get(0).count(), equalTo(1l));
assertThat(facet.entries().get(0).total(), closeTo(1, 0.000001));
assertThat(facet.entries().get(1).from(), closeTo(1000, 0.000001));
assertThat(facet.entries().get(1).to(), closeTo(1170, 0.000001));
assertThat(facet.entries().get(1).count(), equalTo(2l));
assertThat(facet.entries().get(1).total(), closeTo(3, 0.000001));
assertThat(facet.entries().get(2).from(), closeTo(1170, 0.000001));
assertThat(facet.entries().get(2).count(), equalTo(1l));
assertThat(facet.entries().get(2).total(), closeTo(3, 0.000001));
facet = searchResponse.facets().facet("range3");
assertThat(facet.name(), equalTo("range3"));
assertThat(facet.entries().size(), equalTo(3));
assertThat(facet.entries().get(0).to(), closeTo(1056, 0.000001));
assertThat(facet.entries().get(0).count(), equalTo(1l));
assertThat(facet.entries().get(0).totalCount(), equalTo(2l));
assertThat(facet.entries().get(0).total(), closeTo(10 + 11, 0.000001));
assertThat(facet.entries().get(0).min(), closeTo(10, 0.000001));
assertThat(facet.entries().get(0).max(), closeTo(11, 0.000001));
assertThat(facet.entries().get(1).from(), closeTo(1000, 0.000001));
assertThat(facet.entries().get(1).to(), closeTo(1170, 0.000001));
assertThat(facet.entries().get(1).count(), equalTo(2l));
assertThat(facet.entries().get(1).totalCount(), equalTo(4l));
assertThat(facet.entries().get(1).total(), closeTo(62, 0.000001));
assertThat(facet.entries().get(1).min(), closeTo(10, 0.000001));
assertThat(facet.entries().get(1).max(), closeTo(21, 0.000001));
assertThat(facet.entries().get(2).from(), closeTo(1170, 0.000001));
assertThat(facet.entries().get(2).count(), equalTo(1l));
assertThat(facet.entries().get(2).totalCount(), equalTo(2l));
assertThat(facet.entries().get(2).total(), closeTo(61, 0.000001));
assertThat(facet.entries().get(2).min(), closeTo(30, 0.000001));
assertThat(facet.entries().get(2).max(), closeTo(31, 0.000001));
facet = searchResponse.facets().facet("range4");
assertThat(facet.name(), equalTo("range4"));
assertThat(facet.entries().size(), equalTo(3));
assertThat(facet.entries().get(0).to(), closeTo(16, 0.000001));
assertThat(facet.entries().get(0).count(), equalTo(2l));
assertThat(facet.entries().get(0).total(), closeTo(3, 0.000001));
assertThat(facet.entries().get(1).from(), closeTo(10, 0.000001));
assertThat(facet.entries().get(1).to(), closeTo(26, 0.000001));
assertThat(facet.entries().get(1).count(), equalTo(3l));
assertThat(facet.entries().get(1).total(), closeTo(1 + 2 + 3, 0.000001));
assertThat(facet.entries().get(2).from(), closeTo(20, 0.000001));
assertThat(facet.entries().get(2).count(), equalTo(3l));
assertThat(facet.entries().get(2).total(), closeTo(1 + 2 + 3, 0.000001));
facet = searchResponse.facets().facet("range5");
assertThat(facet.name(), equalTo("range5"));
assertThat(facet.entries().size(), equalTo(3));
assertThat(facet.entries().get(0).to(), closeTo(1056, 0.000001));
assertThat(facet.entries().get(0).count(), equalTo(1l));
assertThat(facet.entries().get(0).total(), closeTo(1, 0.000001));
assertThat(facet.entries().get(1).from(), closeTo(1000, 0.000001));
assertThat(facet.entries().get(1).to(), closeTo(1170, 0.000001));
assertThat(facet.entries().get(1).count(), equalTo(2l));
assertThat(facet.entries().get(1).total(), closeTo(3, 0.000001));
assertThat(facet.entries().get(2).from(), closeTo(1170, 0.000001));
assertThat(facet.entries().get(2).count(), equalTo(1l));
assertThat(facet.entries().get(2).total(), closeTo(3, 0.000001));
facet = searchResponse.facets().facet("range6");
assertThat(facet.name(), equalTo("range6"));
assertThat(facet.entries().size(), equalTo(3));
assertThat(facet.entries().get(0).count(), equalTo(2l));
assertThat(facet.entries().get(0).toAsString(), equalTo("1970-01-01T00:00:26"));
assertThat(facet.entries().get(1).count(), equalTo(2l));
assertThat(facet.entries().get(1).fromAsString(), equalTo("1970-01-01T00:00:15"));
assertThat(facet.entries().get(1).toAsString(), equalTo("1970-01-01T00:00:53"));
assertThat(facet.entries().get(2).count(), equalTo(1l));
assertThat(facet.entries().get(2).fromAsString(), equalTo("1970-01-01T00:00:26"));
}
}