Search in sources :

Example 1 with FieldPathIteratorHandler

use of com.yahoo.document.datatypes.FieldPathIteratorHandler 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);
            }
        }
    }
}
Also used : ResultList(com.yahoo.document.select.ResultList) FieldPathIteratorHandler(com.yahoo.document.datatypes.FieldPathIteratorHandler) DocumentPut(com.yahoo.document.DocumentPut)

Aggregations

DocumentPut (com.yahoo.document.DocumentPut)1 FieldPathIteratorHandler (com.yahoo.document.datatypes.FieldPathIteratorHandler)1 ResultList (com.yahoo.document.select.ResultList)1