Class RediSearchUtil

java.lang.Object
redis.clients.jedis.search.RediSearchUtil

public class RediSearchUtil extends Object
  • Field Details

    • ESCAPE_CHARS

      private static final Set<Character> ESCAPE_CHARS
  • Constructor Details

    • RediSearchUtil

      private RediSearchUtil()
  • Method Details

    • toStringMap

      public static Map<String,String> toStringMap(Map<String,Object> input)
      Jedis' hset methods do not support Objects as values. This method eases process of converting a Map with Objects as values so that the returning Map can be set to a hset method.
      Parameters:
      input - map with object value
      Returns:
      map with string value
    • toStringMap

      public static Map<String,String> toStringMap(Map<String,Object> input, boolean stringEscape)
      Jedis' hset methods do not support Objects as values. This method eases process of converting a Map with Objects as values so that the returning Map can be set to a hset method.
      Parameters:
      input - map with object value
      stringEscape - whether to escape the String objects
      Returns:
      map with string value
    • toByteArray

      public static byte[] toByteArray(float[] input)
      x86 systems are little-endian and Java defaults to big-endian. This causes mismatching query results when RediSearch is running in a x86 system. This method helps to convert concerned arrays.
      Parameters:
      input - float array
      Returns:
      byte array
    • ToByteArray

      @Deprecated public static byte[] ToByteArray(float[] input)
      Deprecated.
    • escape

      public static String escape(String text)
    • escapeQuery

      public static String escapeQuery(String query)
    • escape

      public static String escape(String text, boolean querying)
    • unescape

      public static String unescape(String text)