Skip to content

Commit c2b8c63

Browse files
committed
self review, cleanup, add comments
1 parent 8c213cf commit c2b8c63

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

Makefile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ GO_MOD_DIRS := $(shell find . -type f -name 'go.mod' -exec dirname {} \; | sort)
22
export REDIS_MAJOR_VERSION := 7
33

44
test: testdeps
5-
$(eval R_MAJOR := $(shell echo "$(REDIS_VERSION)" | grep -o '\d' | head -1))
65
docker start go-redis-redis-stack || docker run -d --name go-redis-redis-stack -p 6379:6379 -e REDIS_ARGS="--enable-debug-command yes --enable-module-command yes" redis/redis-stack-server:latest
76
$(eval GO_VERSION := $(shell go version | cut -d " " -f 3 | cut -d. -f2))
87
set -e; for dir in $(GO_MOD_DIRS); do \
@@ -24,10 +23,6 @@ test: testdeps
2423
go vet -vettool ./internal/customvet/customvet
2524
docker stop go-redis-redis-stack
2625

27-
dockertest:
28-
docker start go-redis-redis-stack || docker run -d --name go-redis-redis-stack -p 6379:6379 -e REDIS_ARGS="--enable-debug-command yes --enable-module-command yes" redis/redis-stack-server:latest
29-
docker stop go-redis-redis-stack
30-
3126
testdeps: testdata/redis/src/redis-server
3227

3328
bench: testdeps

search_commands.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,9 @@ type FTSearchSortBy struct {
282282
Desc bool
283283
}
284284

285+
// FTSearchOptions hold options that can be passed to the FT.SEARCH command.
286+
// More information about the options can be found
287+
// in the documentation for FT.SEARCH https://redis.io/docs/latest/commands/ft.search/
285288
type FTSearchOptions struct {
286289
NoContent bool
287290
Verbatim bool
@@ -299,7 +302,10 @@ type FTSearchOptions struct {
299302
InOrder bool
300303
Language string
301304
Expander string
302-
// TODO: add document about scorers
305+
// Scorer is used to set scoring function, if not set passed, a default will be used.
306+
// The default scorer depends on the Redis version:
307+
// - `BM25` for Redis >= 8
308+
// - `TFIDF` for Redis < 8
303309
Scorer string
304310
ExplainScore bool
305311
Payload string

search_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ var _ = Describe("RediSearch commands Resp 2", Label("search"), func() {
416416

417417
It("should FTSearch WithScores", Label("search", "ftsearch"), func() {
418418
if REDIS_MAJOR_VERSION >= 8 {
419-
Skip("default scorer is BM25")
419+
Skip("default scorer is not TFIDF")
420420
}
421421
text1 := &redis.FieldSchema{FieldName: "description", FieldType: redis.SearchFieldTypeText}
422422
val, err := client.FTCreate(ctx, "idx1", &redis.FTCreateOptions{}, text1).Result()

0 commit comments

Comments
 (0)