
com.redislabs.lettusearch.aggregate.AggregateOptions Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lettusearch Show documentation
Show all versions of lettusearch Show documentation
Java client for RediSearch based on Lettuce
package com.redislabs.lettusearch.aggregate;
import static com.redislabs.lettusearch.CommandKeyword.LOAD;
import static com.redislabs.lettusearch.CommandKeyword.VERBATIM;
import static com.redislabs.lettusearch.CommandKeyword.WITHSCHEMA;
import java.util.List;
import io.lettuce.core.protocol.CommandArgs;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Singular;
@Data
@EqualsAndHashCode(callSuper = false)
@Builder
public class AggregateOptions extends PropertyArgument {
private boolean withSchema;
private boolean verbatim;
@Singular
private List loads;
@Singular
private List operations;
@Override
public void build(CommandArgs args) {
if (withSchema) {
args.add(WITHSCHEMA);
}
if (verbatim) {
args.add(VERBATIM);
}
if (!loads.isEmpty()) {
args.add(LOAD);
args.add(loads.size());
loads.forEach(load -> args.add(prefix(load)));
}
operations.forEach(operation -> operation.build(args));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy