@@ -0,0 +1,1272 @@
+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;%0A%0Apublic class ValueMappingFilter extends AbstractFilter %7B%0A%0A%09private Map%3CString, String%3E mapping = new HashMap%3C%3E();%0A    private String fieldName;%0A    private Boolean passUndefinedValues = Boolean.TRUE;%0A%0A%09@Override%0A%09public void init() %7B%0A%0A        fieldName = getProperty(%22fieldName%22, null);%0A%09%09passUndefinedValues = getPropertyAsBoolean(%22passUndefinedValues%22, Boolean.TRUE);%0A        verify(%22fieldName%22, %22The field fieldName must be configured.%22);%0A%09%09mapping = getPropertyAsMapping(%22mapping%22);%0A%09%09super.init();%0A%09%7D%0A%0A%09@Override%0A%09public void document(Document document) %7B%0A%09%09List%3CString%3E values = document.getFieldValues(fieldName);%0A%09%09if(values == null) %7B%0A%09%09%09super.document(document);%0A%09%09%09return;%0A%09%09%7D%0A%09%09List%3CString%3E mappedValues = new ArrayList%3C%3E();%0A%09%09for (String value : values) %7B%0A%09%09%09String mappedValue = mapping.get(value);%0A%09%09%09if(mappedValue == null && passUndefinedValues) %7B%0A%09%09%09%09mappedValues.add(value);%0A%09%09%09%7D else %7B%0A%09%09%09%09mappedValues.add(mappedValue);%0A%09%09%09%7D%0A%09%09%7D%0A%09%09document.setField(fieldName, mappedValues);%0A%09%09super.document(document);%0A%09%7D%0A%0A%09%0A%0A%0A%7D%0A

add a value mapping filter