
com.redislabs.lettusearch.aggregate.reducer.RandomSample 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.reducer;
import static com.redislabs.lettusearch.protocol.CommandKeyword.RANDOM_SAMPLE;
import com.redislabs.lettusearch.protocol.RediSearchCommandArgs;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
public @Getter @Setter class RandomSample extends AbstractPropertyReducer {
private int size;
@Builder
private RandomSample(String as, String property, int size) {
super(as, property);
this.size = size;
}
@Override
protected void buildFunction(RediSearchCommandArgs args, String property) {
args.add(RANDOM_SAMPLE);
args.add(2);
args.addProperty(property);
args.add(size);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy