protected TermsEnum filter(Terms terms, AtomicReader reader) throws IOException {
    TermsEnum iterator = terms.iterator(null);
    if (iterator == null) {
      return null;
    }
    if (iterator != null && frequency != null) {
      iterator = FrequencyFilter.filter(iterator, terms, reader, frequency);
    }

    if (iterator != null && regex != null) {
      iterator = RegexFilter.filter(iterator, terms, reader, regex);
    }
    return iterator;
  }
Пример #2
0
 public CompiledRegexFilter(RegexFilter filter) {
   super(filter.enabled, filter.getMatchType(), filter.getRegex(), filter.isUseRegex());
   pattern = LinkgrabberFilterRuleWrapper.createPattern(filter.getRegex(), filter.isUseRegex());
 }