@@ -0,0 +1,2093 @@
+package de.tblsoft.solr.pipeline.filter;%0A%0Aimport de.tblsoft.solr.pipeline.AbstractFilter;%0Aimport de.tblsoft.solr.pipeline.bean.Document;%0Aimport org.apache.commons.lang3.StringUtils;%0Aimport org.jsoup.Jsoup;%0Aimport org.jsoup.nodes.Element;%0Aimport org.jsoup.select.Elements;%0A%0Apublic class ConradJsoupFilter extends AbstractFilter %7B%0A%0A    protected org.jsoup.nodes.Document jsoupDocument;%0A%0A    protected String htmlField;%0A%0A    protected String html;%0A%0A%0A%09@Override%0A%09public void init() %7B%0A        htmlField = getProperty(%22htmlField%22, %22html%22);%0A%09%09super.init();%0A%0A%09%7D%0A%0A%0A%0A%09@Override%0A%09public void document(Document document) %7B%0A        html = document.getFieldValue(htmlField);%0A        jsoupDocument = Jsoup.parse(html);%0A%0A%0A%0A        Elements technicaldetails = jsoupDocument.select(%22section%5Bid=technicaldetail%5D %3E div %3E dl%22);%0A        for (int i = 0; i %3C technicaldetails.size(); i++) %7B%0A            Element detail = technicaldetails.get(i);%0A            String name = detail.select(%22dt %3E div %3E a%22).text();%0A            if(StringUtils.isEmpty(name)) %7B%0A                name = detail.select(%22dt%22).text();%0A            %7D%0A            String value = detail.select(%22dd%22).text();%0A            String key = normalizeKey(name);%0A            document.setField(%22attributekey_%22+ key,value);%0A            document.setField(%22attributename_%22+ key,name);%0A        %7D%0A%0A%0A        Elements breadcrumb = jsoupDocument.select(%22ul%5Bclass=ccpBreadcrumb%5D %3E li%22);%0A        for (int i = 1; i %3C breadcrumb.size(); i++) %7B%0A            Element categoryElement = breadcrumb.get(i);%0A            String category = categoryElement.text();%0A%0A            document.addField(%22category%22,category);%0A        %7D%0A%0A        Elements brandHtml = jsoupDocument.select(%22%5Bitemprop=brand%5D%22);%0A        String brand = brandHtml.text();%0A        if(StringUtils.isEmpty(brand)) %7B%0A            brand = brandHtml.select(%22img%22).attr(%22alt%22);%0A        %7D%0A%0A        document.setField(%22brand%22, brand);%0A        super.document(document);%0A%09%7D%0A%0A%09String normalizeKey(String key) %7B%0A%09    key = key.replaceAll(%22 %22, %22_%22);%0A%09    key = key.replaceAll(%22%5B%5Ea-zA-Z0-9_-%5D+%22,%22%22);%0A        return key;%0A    %7D%0A%0A%0A%0A%0A%0A%7D%0A

add a conrad jsoup filter