Class IndexSchema.Index

java.lang.Object
com.redis.vl.schema.IndexSchema.Index
Enclosing class:
IndexSchema

public static class IndexSchema.Index extends Object
Inner class to hold index configuration
  • Constructor Details

    • Index

      public Index()
      Creates a new Index with default values
    • Index

      public Index(String name)
      Creates a new Index with the given name
      Parameters:
      name - the name of the index
  • Method Details

    • getName

      public String getName()
      Get the index name
      Returns:
      the index name
    • setName

      public void setName(String name)
      Set the index name
      Parameters:
      name - the index name to set
    • getPrefix

      public String getPrefix()
      Get the key prefix (normalized).

      If multiple prefixes are configured, returns the first one for Redis key construction. This matches Python behavior: prefix[0] if isinstance(prefix, list) else prefix.

      Returns:
      the normalized key prefix (first prefix if multiple), or null if not set
    • getPrefixRaw

      public Object getPrefixRaw()
      Get the raw prefix value (can be String or List).

      This method returns the prefix exactly as stored, without normalization. Use getPrefix() for the normalized prefix used in key construction.

      Returns:
      the raw prefix (String or List of String), or null if not set
    • setPrefix

      public void setPrefix(String prefix)
      Set the key prefix (single prefix)
      Parameters:
      prefix - the key prefix to set
    • setPrefix

      public void setPrefix(List<String> prefixes)
      Set multiple key prefixes.

      Normalizes single-element lists to strings for backward compatibility. Python port: matches behavior in convert_index_info_to_schema.

      Parameters:
      prefixes - the list of key prefixes to set
    • getKeySeparator

      public String getKeySeparator()
      Get the key separator
      Returns:
      the key separator
    • setKeySeparator

      public void setKeySeparator(String keySeparator)
      Set the key separator
      Parameters:
      keySeparator - the key separator to set
    • getStorageType

      public IndexSchema.StorageType getStorageType()
      Get the storage type
      Returns:
      the storage type
    • setStorageType

      public void setStorageType(IndexSchema.StorageType storageType)
      Set the storage type
      Parameters:
      storageType - the storage type to set
    • getStopwords

      public List<String> getStopwords()
      Get the stopwords configuration.
      Returns:
      null for default stopwords, empty list for disabled, or custom stopwords list
    • setStopwords

      public void setStopwords(List<String> stopwords)
      Set the stopwords configuration.

      Pass null to use Redis default stopwords, empty list to disable stopwords entirely (STOPWORDS 0), or a custom list of stopwords.

      Parameters:
      stopwords - the stopwords configuration
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object