summaryrefslogtreecommitdiff
path: root/redis/commands/search/_util.py
diff options
context:
space:
mode:
authorChayim <chayim@users.noreply.github.com>2021-10-25 17:18:27 +0300
committerGitHub <noreply@github.com>2021-10-25 17:18:27 +0300
commitddd1496782cc8eb15fca6c9059b2b08a03efe366 (patch)
treeab907bd2fd2f7cfb951e750de69ea9d4478a5b9c /redis/commands/search/_util.py
parent3946da29d7e451a20289fb6e282516fa24e402af (diff)
downloadredis-py-ddd1496782cc8eb15fca6c9059b2b08a03efe366.tar.gz
Adding support for redisearch (#1640)
Diffstat (limited to 'redis/commands/search/_util.py')
-rw-r--r--redis/commands/search/_util.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/redis/commands/search/_util.py b/redis/commands/search/_util.py
new file mode 100644
index 0000000..b4ac19f
--- /dev/null
+++ b/redis/commands/search/_util.py
@@ -0,0 +1,10 @@
+import six
+
+
+def to_string(s):
+ if isinstance(s, six.string_types):
+ return s
+ elif isinstance(s, six.binary_type):
+ return s.decode("utf-8", "ignore")
+ else:
+ return s # Not a string we care about