From 9bd3afe894e870a242dd3b8c0c419ad8233ffae9 Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Tue, 19 Sep 2023 20:49:59 +0600 Subject: [PATCH] private variable --- src/main/java/redis/clients/jedis/search/RediSearchUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/redis/clients/jedis/search/RediSearchUtil.java b/src/main/java/redis/clients/jedis/search/RediSearchUtil.java index 48f89adfbe..b32a7d1f7e 100644 --- a/src/main/java/redis/clients/jedis/search/RediSearchUtil.java +++ b/src/main/java/redis/clients/jedis/search/RediSearchUtil.java @@ -57,7 +57,7 @@ public static byte[] ToByteArray(float[] input) { return bytes; } - public static final Set TAG_ESCAPE_CHARS = new HashSet<>(Arrays.asList(// + private static final Set ESCAPE_CHARS = new HashSet<>(Arrays.asList(// ',', '.', '<', '>', '{', '}', '[', // ']', '"', '\'', ':', ';', '!', '@', // '#', '$', '%', '^', '&', '*', '(', // @@ -77,7 +77,7 @@ public static String escape(String text, boolean querying) { StringBuilder sb = new StringBuilder(); for (char ch : chars) { - if (TAG_ESCAPE_CHARS.contains(ch) + if (ESCAPE_CHARS.contains(ch) || (querying && ch == ' ')) { sb.append("\\"); }