Skip to content

Commit 46f97c7

Browse files
committed
Addscores is available in later redisearch releases.
For safety state it is available in redis ce 8
1 parent 35101a5 commit 46f97c7

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

search_commands.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,8 @@ type FTAggregateOptions struct {
251251
// The default scorer depends on the Redis version:
252252
// - `BM25` for Redis >= 8
253253
// - `TFIDF` for Redis < 8
254-
Scorer string
254+
Scorer string
255+
// AddScores is available in Redis CE 8
255256
AddScores bool
256257
Apply []FTAggregateApply
257258
LimitOffset int

search_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,8 @@ var _ = Describe("RediSearch commands Resp 2", Label("search"), func() {
645645
Expect(res.Rows[0].Fields["t2"]).To(BeEquivalentTo("world"))
646646
})
647647

648-
It("should FTAggregate with scorer and addscores", Label("search", "ftaggregate"), func() {
648+
It("should FTAggregate with scorer and addscores", Label("search", "ftaggregate", "NonRedisEnterprise"), func() {
649+
SkipBeforeRedisMajor(8, "ADDSCORES is available in Redis CE 8")
649650
title := &redis.FieldSchema{FieldName: "title", FieldType: redis.SearchFieldTypeText, Sortable: false}
650651
description := &redis.FieldSchema{FieldName: "description", FieldType: redis.SearchFieldTypeText, Sortable: false}
651652
val, err := client.FTCreate(ctx, "idx1", &redis.FTCreateOptions{OnHash: true, Prefix: []interface{}{"product:"}}, title, description).Result()

0 commit comments

Comments
 (0)