@@ -0,0 +1,1983 @@
+package de.tblsoft.solr.pipeline.filter;%0A%0Aimport de.tblsoft.solr.pipeline.AbstractFilter;%0Aimport de.tblsoft.solr.pipeline.bean.Document;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.HashMap;%0Aimport java.util.List;%0Aimport java.util.Map;%0Aimport java.util.regex.Matcher;%0Aimport java.util.regex.Pattern;%0A%0A/**%0A * Created by tblsoft 19.08.18.%0A */%0Apublic class RegexExtractFilter extends AbstractFilter %7B%0A%0A    private String fieldName;%0A    private Pattern pattern;%0A%0A    private boolean shouldMatch = true;%0A%0A    private Map%3CString, String%3E mapping;%0A%0A    @Override%0A    public void init() %7B%0A        fieldName = getProperty(%22fieldName%22, null);%0A        verify(fieldName, %22For the GrepFilter a fieldName must be defined.%22);%0A%0A        String patternString = getProperty(%22pattern%22, null);%0A        verify(patternString, %22For the GrepFilter a pattern must be defined.%22);%0A        pattern = Pattern.compile(patternString);%0A%0A        shouldMatch = getPropertyAsBoolean(%22shouldMatch%22, true);%0A%0A%0A        List%3CString%3E mappingConfiguration = getPropertyAsList(%22mapping%22, new ArrayList%3CString%3E());%0A        mapping = new HashMap%3C%3E();%0A        readConfig(mappingConfiguration);%0A%0A        super.init();%0A    %7D%0A%0A%0A    @Override%0A    public void document(Document document) %7B%0A%0A        List%3CString%3E values = document.getFieldValues(fieldName, new ArrayList%3CString%3E());%0A        for(String value: values) %7B%0A            value = value.replaceAll(%22%5C%5Cr%5C%5Cn%7C%5C%5Cr%7C%5C%5Cn%22, %22 %22);%0A            Matcher m = pattern.matcher(value);%0A            if(shouldMatch && !m.matches()) %7B%0A                //document.deleteField(fieldName);%0A            %7D else if (!shouldMatch && m.matches()) %7B%0A                //document.deleteField(fieldName);%0A            %7D else %7B%0A                super.document(document);%0A            %7D%0A        %7D%0A%0A    %7D%0A%0A%0A    private void readConfig(List%3CString%3E mappingConfiguration) %7B%0A        for (String v : mappingConfiguration) %7B%0A            String%5B%5D s = v.split(%22-%3E%22);%0A            mapping.put(s%5B0%5D, s%5B1%5D);%0A        %7D%0A    %7D%0A%0A%7D%0A

add a regex extract filter