@Test(expected = RuntimeException.class) public void extractFacetCounts_NO_FACET() { xFieldFacetExtractor.extractFacetCounts(new QueryResponse(), XField.JUDGMENT_DATE); }
public List<FacetCount> extractFacetCounts(QueryResponse response, XField xField) { Preconditions.checkNotNull(response); Preconditions.checkNotNull(xField); String fieldName = xFieldNameMapper.mapXField(xField); RangeFacet<?, ?> facetRange = extractRangeFacet(response, fieldName); FacetField facetField = extractFieldFacet(response, fieldName); if (facetRange != null) { return convertRangeFacetCounts(facetRange); } if (facetField != null) { return convertFieldFacetCounts(facetField); } throw new RuntimeException("No field or range facet for field name " + fieldName + " in solr query response"); }
XFieldFacetExtractor { public List<FacetCount> extractFacetCounts(QueryResponse response, XField xField) { Preconditions.checkNotNull(response); Preconditions.checkNotNull(xField); String fieldName = xFieldNameMapper.mapXField(xField); RangeFacet<?, ?> facetRange = extractRangeFacet(response, fieldName); FacetField facetField = extractFieldFacet(response, fieldName); if (facetRange != null) { return convertRangeFacetCounts(facetRange); } if (facetField != null) { return convertFieldFacetCounts(facetField); } throw new RuntimeException("No field or range facet for field name " + fieldName + " in solr query response"); } }
XFieldFacetExtractor { public List<FacetCount> extractFacetCounts(QueryResponse response, XField xField) { Preconditions.checkNotNull(response); Preconditions.checkNotNull(xField); String fieldName = xFieldNameMapper.mapXField(xField); RangeFacet<?, ?> facetRange = extractRangeFacet(response, fieldName); FacetField facetField = extractFieldFacet(response, fieldName); if (facetRange != null) { return convertRangeFacetCounts(facetRange); } if (facetField != null) { return convertFieldFacetCounts(facetField); } throw new RuntimeException("No field or range facet for field name " + fieldName + " in solr query response"); }  }
XFieldFacetExtractor { public List<FacetCount> extractFacetCounts(QueryResponse response, XField xField) { Preconditions.checkNotNull(response); Preconditions.checkNotNull(xField); String fieldName = xFieldNameMapper.mapXField(xField); RangeFacet<?, ?> facetRange = extractRangeFacet(response, fieldName); FacetField facetField = extractFieldFacet(response, fieldName); if (facetRange != null) { return convertRangeFacetCounts(facetRange); } if (facetField != null) { return convertFieldFacetCounts(facetField); } throw new RuntimeException("No field or range facet for field name " + fieldName + " in solr query response"); }  List<FacetCount> extractFacetCounts(QueryResponse response, XField xField); @Resource void setxFieldNameMapper(XFieldNameMapper xFieldNameMapper); }
XFieldFacetExtractor { public List<FacetCount> extractFacetCounts(QueryResponse response, XField xField) { Preconditions.checkNotNull(response); Preconditions.checkNotNull(xField); String fieldName = xFieldNameMapper.mapXField(xField); RangeFacet<?, ?> facetRange = extractRangeFacet(response, fieldName); FacetField facetField = extractFieldFacet(response, fieldName); if (facetRange != null) { return convertRangeFacetCounts(facetRange); } if (facetField != null) { return convertFieldFacetCounts(facetField); } throw new RuntimeException("No field or range facet for field name " + fieldName + " in solr query response"); }  List<FacetCount> extractFacetCounts(QueryResponse response, XField xField); @Resource void setxFieldNameMapper(XFieldNameMapper xFieldNameMapper);  }