use of ddf.catalog.source.solr.DynamicSchemaResolver.FIRST_CHAR_OF_SUFFIX in project ddf by codice.
the class SolrMetacardClientImpl method handleFacetRequest.
private boolean handleFacetRequest(SolrQuery query, QueryRequest request) {
boolean isFacetedQuery = false;
Serializable textFacetPropRaw = request.getPropertyValue(EXPERIMENTAL_FACET_PROPERTIES_KEY);
if (textFacetPropRaw instanceof TermFacetProperties) {
TermFacetProperties textFacetProp = (TermFacetProperties) textFacetPropRaw;
isFacetedQuery = true;
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("Enabling faceted query for request [{}] on field {}", request, textFacetProp);
}
textFacetProp.getFacetAttributes().stream().map(this::addAttributeTypeSuffix).filter(attr -> attr.contains(String.valueOf(FIRST_CHAR_OF_SUFFIX))).forEach(query::addFacetField);
query.setFacetSort(textFacetProp.getSortKey().name().toLowerCase());
query.setFacetLimit(textFacetProp.getFacetLimit());
query.setFacetMinCount(textFacetProp.getMinFacetCount());
}
return isFacetedQuery;
}
Aggregations