@@ -42,7 +42,12 @@ public class RediSearchConfig {
4242
4343 private String defaultSchema = DEFAULT_SCHEMA ;
4444 private Optional <String > uri = Optional .empty ();
45+ private Optional <String > username = Optional .empty ();
46+ private Optional <String > password = Optional .empty ();
4547 private boolean caseInsensitiveNameMatching ;
48+ private boolean insecure ;
49+ private boolean tls ;
50+ private long timeout ;
4651 private long defaultLimit = DEFAULT_LIMIT ;
4752 private long cursorCount = 0 ; // Use RediSearch default
4853 private long tableCacheExpiration = DEFAULT_TABLE_CACHE_EXPIRATION .toSeconds ();
@@ -116,6 +121,30 @@ public RediSearchConfig setUri(String uri) {
116121 return this ;
117122 }
118123
124+ public Optional <String > getUsername () {
125+ return username ;
126+ }
127+
128+ @ Config ("redisearch.username" )
129+ @ ConfigDescription ("Redis connection username" )
130+ @ ConfigSecuritySensitive
131+ public RediSearchConfig setUsername (String username ) {
132+ this .username = Optional .ofNullable (username );
133+ return this ;
134+ }
135+
136+ public Optional <String > getPassword () {
137+ return password ;
138+ }
139+
140+ @ Config ("redisearch.password" )
141+ @ ConfigDescription ("Redis connection password" )
142+ @ ConfigSecuritySensitive
143+ public RediSearchConfig setPassword (String password ) {
144+ this .password = Optional .ofNullable (password );
145+ return this ;
146+ }
147+
119148 public boolean isCaseInsensitiveNameMatching () {
120149 return caseInsensitiveNameMatching ;
121150 }
@@ -127,4 +156,36 @@ public RediSearchConfig setCaseInsensitiveNameMatching(boolean caseInsensitiveNa
127156 return this ;
128157 }
129158
159+ public boolean isInsecure () {
160+ return insecure ;
161+ }
162+
163+ @ Config ("redisearch.insecure" )
164+ @ ConfigDescription ("Allow insecure connections (e.g. invalid certificates) to Redis when using SSL" )
165+ public RediSearchConfig setInsecure (boolean insecure ) {
166+ this .insecure = insecure ;
167+ return this ;
168+ }
169+
170+ public boolean isTls () {
171+ return tls ;
172+ }
173+
174+ @ Config ("redisearch.tls" )
175+ @ ConfigDescription ("Establish a secure TLS connection" )
176+ public RediSearchConfig setTls (boolean tls ) {
177+ this .tls = tls ;
178+ return this ;
179+ }
180+
181+ public long getTimeout () {
182+ return timeout ;
183+ }
184+
185+ @ Config ("redisearch.timeout" )
186+ @ ConfigDescription ("Redis command timeout in seconds" )
187+ public RediSearchConfig setTimeout (long timeout ) {
188+ this .timeout = timeout ;
189+ return this ;
190+ }
130191}
0 commit comments