Class RegexMetadataFilter

  • All Implemented Interfaces:
    IXMLConfigurable, IDocumentFilter, IOnMatchFilter, IImporterHandler

    @Deprecated
    public class RegexMetadataFilter
    extends AbstractDocumentFilter
    Deprecated.
    Since 3.0.0, use TextFilter instead.

    Accepts or rejects a document based on its field values using regular expression.

    XML configuration usage:

      <handler class="com.norconex.importer.handler.filter.impl.RegexMetadataFilter"
              onMatch="[include|exclude]"
              caseSensitive="[false|true]"
              field="(name of metadata name to match)" >
    
          <restrictTo caseSensitive="[false|true]"
                  field="(name of header/metadata field name to match)">
              (regular expression of value to match)
          </restrictTo>
          <!-- multiple "restrictTo" tags allowed (only one needs to match) -->
    
          <regex>(regular expression of value to match)</regex>
      </handler>
     

    Usage example:

    This example will accept only documents containing word "potato" in the title.

      <handler class="RegexMetadataFilter"
              onMatch="include" field="title" >
          <regex>.*potato.*</regex>
      </handler>
     
    Author:
    Pascal Essiembre