use of de.tblsoft.solr.pipeline.FilterIF in project solr-cmd-utils by tblsoft.
the class AbstractFilterTest method initFilter.
FilterIF initFilter() {
FilterIF filter = PipelineExecuter.createFilterInstance(filterConfig);
this.testingFilter = new TestingFilter();
testingFilter.setNextFilter(new LastFilter());
filter.setNextFilter(testingFilter);
filter.init();
return filter;
}
use of de.tblsoft.solr.pipeline.FilterIF in project solr-cmd-utils by tblsoft.
the class ForkDocumentFilter method initPipelineFilters.
protected void initPipelineFilters() {
String includeFilters = getProperty("include", null);
String absoluteFile = IOUtils.getAbsoluteFile(getBaseDir(), includeFilters);
FiltersPipeline filtersPipeline = readFiltersFromYamlFile(absoluteFile);
// init
FilterIF lastFilter = null;
FilterIF filterInstance = null;
try {
for (int i = 0; i < filtersPipeline.getFilter().size(); i++) {
Filter filter = filtersPipeline.getFilter().get(i);
if (filter.getDisabled() != null && filter.getDisabled()) {
continue;
}
filterInstance = PipelineExecuter.createFilterInstance(filter);
filterInstance.setBaseDir(getBaseDir());
filterInstance.setVariables(variables);
if (lastFilter == null) {
lastFilter = filterInstance;
continue;
}
lastFilter.setNextFilter(filterInstance);
filterList.add(lastFilter);
lastFilter = filterInstance;
}
filterInstance.setNextFilter(new LastFilter());
filterList.add(filterInstance);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException(e);
}
filterList.get(0).init();
}
use of de.tblsoft.solr.pipeline.FilterIF in project solr-cmd-utils by tblsoft.
the class AbstractFilterTest method document.
protected List<Document> document(Document... document) {
FilterIF filter = initFilter();
for (Document d : document) {
filter.document(d);
}
filter.end();
outputDocumentList = testingFilter.getDocumentList();
return outputDocumentList;
}
Aggregations