Skip to content

Commit 98cef55

Browse files
[FIX] RediSearch - Allow for explicit Jedis Client to be used on index creation.
1 parent 31978ed commit 98cef55

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "RediSearch"
22
uuid = "353f7206-d691-4bbb-b12e-a9a2d4b8f055"
33
authors = ["Jackson Calvert-Lane <[email protected]>"]
4-
version = "0.1.0"
4+
version = "0.1.1"
55

66
[deps]
77
Jedis = "b89ccfe0-2c5f-46f6-b89b-da3e1c2e286f"

src/client.jl

+3-1
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,12 @@ function create_index(
8888
)
8989
args = []
9090
append!(args, [SearchCommands.CREATE_CMD, client.index_name])
91+
redis_client = client.client
9192

9293
if !isnothing(definition)
9394
append!(args, definition.args)
9495
end
96+
9597
if max_text_fields
9698
push!(args, SearchCommands.MAXTEXTFIELDS)
9799
end
@@ -137,7 +139,7 @@ function create_index(
137139
end
138140

139141
append!(args, schema_args)
140-
return Jedis.execute(args)
142+
return Jedis.execute(args, redis_client)
141143
end
142144

143145

src/fields.jl

+4-4
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,16 @@ function Field(
7373
as_name=nothing,
7474
)
7575
if !isnothing(as_name)
76-
append!(args, [Fields.AS, as_name])
76+
args = vcat(args, [Fields.AS, as_name])
7777
end
7878

7979
if sortable
80-
push!(args, Fields.SORTABLE)
80+
append!(args, [Fields.SORTABLE])
8181
end
8282

8383
if no_index
8484
sortable && throw(ErrorException("Cannot Allow for Sortable and No Index on Field"))
85-
push!(args, Fields.NOINDEX)
85+
append!(args, [Fields.NOINDEX])
8686
end
8787

8888
return Field(name, args, sortable, no_index, as_name)
@@ -113,7 +113,7 @@ function TextField(name; weight=1.0, no_stem=false, phonetic="", kwargs...)
113113
end
114114

115115
if no_stem
116-
push!(field.args, Fields.NOSTEM)
116+
append!(field.args, [Fields.NOSTEM])
117117
end
118118

119119
return field

0 commit comments

Comments
 (0)