/** * Removes the expiration flag. */ public void removeExpiration() { if (getFilterQueries() != null) { for (String fq : getFilterQueries()) { if (fq.startsWith(CmsSearchField.FIELD_DATE_EXPIRED + ":") || fq.startsWith(CmsSearchField.FIELD_DATE_RELEASED + ":")) { removeFilterQuery(fq); } } } m_ignoreExpiration = true; }
/** * Removes those filter queries that restrict the fields used in the given filter query Strings.<p> * * Searches in the given Strings for a ":", then takes the field name part * and removes the already set filter queries queries that are matching the same field name.<p> * * @param fqs the filter query Strings in the format <code>fq=fieldname:value</code> that should be removed */ private void removeFilterQueries(String[] fqs) { // iterate over the given filter queries to remove for (String fq : fqs) { int idx = fq.indexOf(':'); if (idx != -1) { // get the field name of the fq to remove String fieldName = fq.substring(0, idx); // iterate over the fqs of the already existing fqs from the solr query if (getFilterQueries() != null) { for (String sfq : getFilterQueries()) { if (sfq.startsWith(fieldName + ":")) { // there exists a filter query for exact the same field, remove it removeFilterQuery(sfq); } } } } } }
for (String fq : getFilterQueries()) { if (fq.startsWith(CmsSearchField.FIELD_CONTENT_LOCALES + ":")) { removeFilterQuery(fq);
/** * Creates and adds a filter query.<p> * * @param fieldName the field name to create a filter query on * @param vals the values that should match for the given field * @param all <code>true</code> to combine the given values with 'AND', <code>false</code> for 'OR' * @param useQuotes <code>true</code> to surround the given values with double quotes, <code>false</code> otherwise */ public void addFilterQuery(String fieldName, List<String> vals, boolean all, boolean useQuotes) { if (getFilterQueries() != null) { for (String fq : getFilterQueries()) { if (fq.startsWith(fieldName + ":")) { removeFilterQuery(fq); } } } addFilterQuery(createFilterQuery(fieldName, vals, all, useQuotes)); }