Skip to content

Commit a0cc177

Browse files
committed
#935 Made combined excluding optional
Default to false but configurable in the future via config file.
1 parent 6a50c91 commit a0cc177

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/main/java/au/org/ala/biocache/util/QueryFormatUtils.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,14 @@ public class QueryFormatUtils {
9090
@Value("${solr.circle.segments:18}")
9191
int solrCircleSegments = 18;
9292

93+
/**
94+
* When facet tagging/excluding is enabled, this flag determines whether to combine
95+
* multiple excluded facet fields into each facet {!ex} tag.
96+
* @see au.org.ala.biocache.util.QueryFormatUtils#applyFilterTagging(au.org.ala.biocache.dto.SpatialSearchRequestDTO)
97+
*/
98+
@Value("${facets.combineExcludedFields:false}")
99+
boolean combineExcludedFacetFields = false;
100+
93101
/**
94102
* This is appended to the query displayString when SpatialSearchRequestParams.wkt is used.
95103
*/
@@ -230,7 +238,7 @@ private void applyFilterTagging(SpatialSearchRequestDTO searchParams) {
230238
// Add the excluded fields to the facetPivotList || facetList
231239
for (String f : searchParams.getFacets()) {
232240
if (excludedFields.contains(f)) {
233-
String prefix = "{!ex=" + String.join(",", excludedFields) + "}";
241+
String prefix = combineExcludedFacetFields ? "{!ex=" + String.join(",", excludedFields) + "}" : "{!ex=" + f + "}";
234242
facetPivotList.add(prefix + f);
235243
} else {
236244
facetList.add(f);

0 commit comments

Comments
 (0)