Fixed - STOPWORDS 0 can't be defined during RSearch index creation.

pull/6396/head
Nikita Koksharov 2 weeks ago
parent 7ea88fbce2
commit d31be67220

@ -123,10 +123,14 @@ public class RedissonSearch implements RSearch {
if (options.isNoFreqs()) {
args.add("NOFREQS");
}
if (!options.getStopwords().isEmpty()) {
if (options.getStopwords() != null) {
args.add("STOPWORDS");
args.add(options.getStopwords().size());
args.addAll(options.getStopwords());
if (options.getStopwords().isEmpty()) {
args.add(0);
} else {
args.add(options.getStopwords().size());
args.addAll(options.getStopwords());
}
}
if (options.isSkipInitialScan()) {
args.add("SKIPINITIALSCAN");

@ -39,7 +39,7 @@ public final class IndexOptions {
private String scoreField;
private boolean noHL;
private boolean noFreqs;
private List<String> stopwords = Collections.emptyList();
private List<String> stopwords;
private boolean skipInitialScan;
private IndexType on;
private byte[] payloadField;

@ -61,6 +61,7 @@ public class RedissonSearchTest extends DockerRedisStackTest {
RSearch s = redisson.getSearch();
s.createIndex("idx", IndexOptions.defaults()
.on(IndexType.HASH)
.stopwords(Collections.emptyList())
.prefix(Arrays.asList("doc:")),
FieldIndex.text("t1"),
FieldIndex.text("t2"));

Loading…
Cancel
Save