From e19280fcdd2ac90a3f18a28439887d51461eec75 Mon Sep 17 00:00:00 2001 From: ofekshenawa Date: Mon, 11 Sep 2023 14:55:29 +0300 Subject: [PATCH] Add RediSearch Support --- .github/wordlist.txt | 3 ++- redis_search.go | 14 ++++++++++++++ redis_search_test.go | 27 +++++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 redis_search.go create mode 100644 redis_search_test.go diff --git a/.github/wordlist.txt b/.github/wordlist.txt index 32aba831..19f01b10 100644 --- a/.github/wordlist.txt +++ b/.github/wordlist.txt @@ -53,4 +53,5 @@ URI url variadic RedisStack -RedisGears \ No newline at end of file +RedisGears +RediSearch diff --git a/redis_search.go b/redis_search.go new file mode 100644 index 00000000..a2626395 --- /dev/null +++ b/redis_search.go @@ -0,0 +1,14 @@ +package redis + +import ( + "context" +) + +type SearchCmdable interface { +} + +func (c cmdable) FT_List(ctx context.Context) *StringSliceCmd { + cmd := NewStringSliceCmd(ctx, "FT._LIST") + _ = c(ctx, cmd) + return cmd +} diff --git a/redis_search_test.go b/redis_search_test.go new file mode 100644 index 00000000..84a45036 --- /dev/null +++ b/redis_search_test.go @@ -0,0 +1,27 @@ +package redis_test + +import ( + "context" + + . "github.com/bsm/ginkgo/v2" + . "github.com/bsm/gomega" + "github.com/redis/go-redis/v9" +) + +var _ = Describe("RediSearch commands", Label("gears"), func() { + ctx := context.TODO() + var client *redis.Client + + BeforeEach(func() { + client = redis.NewClient(&redis.Options{Addr: ":6379"}) + Expect(client.FlushDB(ctx).Err()).NotTo(HaveOccurred()) + }) + + AfterEach(func() { + Expect(client.Close()).NotTo(HaveOccurred()) + }) + + It("should FT_List ", Label("search", "ft_list"), func() { + + }) +})