Skip to content

Commit

Permalink
Merge pull request #69 from andrewkdouglas/fix/redisearch-init-error
Browse files Browse the repository at this point in the history
Improve handling of RediSearch "unknown: index name" error
  • Loading branch information
Czechh authored Aug 21, 2023
2 parents 3a1dcf6 + c567002 commit 8edb85d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/redis_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub fn ensure_redisearch_index(
let index_info: Result<redis::Value, _> = redis::cmd("FT.INFO").arg(index_name).query(&mut con);

if let Err(err) = index_info {
if err.to_string().contains("Unknown: Index name") {
if err.to_string().to_lowercase().contains("unknown: index name") {
redis::cmd("FT.CREATE")
.arg(index_name)
.arg("ON")
Expand Down

0 comments on commit 8edb85d

Please sign in to comment.