use of com.yahoo.document.select.ResultList in project vespa by vespa-engine.
the class FieldPathUpdate method applyTo.
public void applyTo(Document doc) {
if (selector == null) {
FieldPathIteratorHandler handler = getIteratorHandler(doc);
doc.iterateNested(fieldPath, 0, handler);
} else {
ResultList results = selector.getMatchingResultList(new DocumentPut(doc));
for (ResultList.ResultPair rp : results.getResults()) {
if (rp.getResult() == Result.TRUE) {
FieldPathIteratorHandler handler = getIteratorHandler(doc);
handler.getVariables().clear();
handler.getVariables().putAll(rp.getVariables());
doc.iterateNested(fieldPath, 0, handler);
}
}
}
}
Aggregations