Search in sources :

Example 1 with ResultNode

use of com.yahoo.searchlib.expression.ResultNode in project vespa by vespa-engine.

the class Grouping method unifyNull.

public void unifyNull() {
    class FindGroup implements ObjectPredicate {

        @Override
        public boolean check(Object obj) {
            return obj instanceof Group;
        }
    }
    class UnifyNullGroupId implements ObjectOperation {

        @Override
        public void execute(Object obj) {
            Group group = (Group) obj;
            ResultNode id = group.getId();
            if (id instanceof BucketResultNode && ((BucketResultNode) id).empty()) {
                group.setId(new NullResultNode());
            }
        }
    }
    selectMembers(new FindGroup(), new UnifyNullGroupId());
}
Also used : BucketResultNode(com.yahoo.searchlib.expression.BucketResultNode) NullResultNode(com.yahoo.searchlib.expression.NullResultNode) BucketResultNode(com.yahoo.searchlib.expression.BucketResultNode) ResultNode(com.yahoo.searchlib.expression.ResultNode) NullResultNode(com.yahoo.searchlib.expression.NullResultNode)

Aggregations

BucketResultNode (com.yahoo.searchlib.expression.BucketResultNode)1 NullResultNode (com.yahoo.searchlib.expression.NullResultNode)1 ResultNode (com.yahoo.searchlib.expression.ResultNode)1