Source:
protected void buildAuditQuery(boolean includeSort) { PageProviderDefinition def = getDefinition(); Object[] params = getParameters(); List<QuickFilter> quickFilters = getQuickFilters(); String quickFiltersClause = ""; if (quickFilters != null && !quickFilters.isEmpty()) { for (int i = 0; i < quickFilters.size(); i++) { if (!quickFiltersClause.isEmpty() && quickFilters.get(i).getClause() != null) { quickFiltersClause += NXQLQueryBuilder.appendClause(quickFiltersClause, quickFilters.get(i).getClause()); } else { quickFiltersClause = quickFilters.get(i).getClause() != null ? quickFilters.get(i).getClause() : ""; } } } if (def.getWhereClause() == null) { if (!allowSimplePattern()) { throw new UnsupportedOperationException("This page provider requires a explicit Where Clause"); } String pattern = quickFiltersClause.isEmpty() ? def.getPattern() : NXQLQueryBuilder.appendClause(def.getPattern(), quickFiltersClause); String baseQuery = getESBackend().expandQueryVariables(pattern, params); searchBuilder = getESBackend().buildQuery(baseQuery, null); } else { if (!quickFiltersClause.isEmpty()) { String fixedPart = def.getWhereClause().getFixedPart(); if (fixedPart != null) { def.getWhereClause().setFixedPart(NXQLQueryBuilder.appendClause(fixedPart, quickFiltersClause)); } else { def.getWhereClause().setFixedPart(quickFiltersClause); } } String baseQuery = getESBackend().expandQueryVariables(getFixedPart(), params); searchBuilder = getESBackend().buildSearchQuery(baseQuery, def.getWhereClause().getPredicates(), getSearchDocumentModel()); } }

Target:
protected void buildAuditQuery(boolean includeSort) { PageProviderDefinition def = getDefinition(); Object[] params = getParameters(); List<QuickFilter> quickFilters = getQuickFilters(); String quickFiltersClause = ""; if (quickFilters != null && !quickFilters.isEmpty()) { for (QuickFilter quickFilter : quickFilters) { String clause = quickFilter.getClause(); if (!quickFiltersClause.isEmpty() && clause != null) { quickFiltersClause = NXQLQueryBuilder.appendClause(quickFiltersClause, clause); } else { quickFiltersClause = clause != null ? clause : ""; } } } WhereClauseDefinition whereClause = def.getWhereClause(); if (whereClause == null) { if (!allowSimplePattern()) { throw new UnsupportedOperationException("This page provider requires a explicit Where Clause"); } String originalPattern = def.getPattern(); String pattern = quickFiltersClause.isEmpty() ? originalPattern : StringUtils.containsIgnoreCase(originalPattern, "WHERE") ? NXQLQueryBuilder.appendClause(originalPattern, quickFiltersClause) : originalPattern + " WHERE " + quickFiltersClause; String baseQuery = getESBackend().expandQueryVariables(pattern, params); searchBuilder = getESBackend().buildQuery(baseQuery, null); } else { if (!quickFiltersClause.isEmpty()) { String fixedPart = whereClause.getFixedPart(); if (fixedPart != null) { whereClause.setFixedPart(NXQLQueryBuilder.appendClause(fixedPart, quickFiltersClause)); } else { whereClause.setFixedPart(quickFiltersClause); } } String baseQuery = getESBackend().expandQueryVariables(getFixedPart(), params); searchBuilder = getESBackend().buildSearchQuery(baseQuery, whereClause.getPredicates(), getSearchDocumentModel()); } }