code: public Query buildRelaxedQuery(AbstractPatternRule rule) throws UnsupportedPatternRuleException {
      BooleanQuery.Builder builder = new BooleanQuery.Builder();
      for (PatternToken patternToken : rule.getPatternTokens()) {
        try {
          BooleanClause clause = makeQuery(patternToken);
          builder.add(clause);
        } catch (UnsupportedPatternRuleException e) {
          //System.out.println("Ignoring because it's not supported: " + element + ": " + e);
          // cannot handle - okay to ignore, as we may return too broad matches
        } catch (Exception e) {
          throw new RuntimeException("Could not create query for rule " + rule.getId(), e);
        }
      }
      BooleanQuery query = builder.build();
      if (query.clauses().isEmpty()) {
        throw new UnsupportedPatternRuleException("No items found in rule that can be used to build a search query: " + rule);
      }
      return query;
    }
docs: Iterate over all elements, ignore those not supported, add the other ones to a BooleanQuery.
  @throws UnsupportedPatternRuleException if no query could be created for the rule