Package com.redis.vl.schema
Class IndexSchema.Index
java.lang.Object
com.redis.vl.schema.IndexSchema.Index
- Enclosing class:
IndexSchema
Inner class to hold index configuration
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanGet the key separatorgetName()Get the index nameGet the key prefix (normalized).Get the raw prefix value (can be String or List).Get the stopwords configuration.Get the storage typeinthashCode()voidsetKeySeparator(String keySeparator) Set the key separatorvoidSet the index namevoidSet the key prefix (single prefix)voidSet multiple key prefixes.voidsetStopwords(List<String> stopwords) Set the stopwords configuration.voidsetStorageType(IndexSchema.StorageType storageType) Set the storage type
-
Constructor Details
-
Index
public Index()Creates a new Index with default values -
Index
Creates a new Index with the given name- Parameters:
name- the name of the index
-
-
Method Details
-
getName
Get the index name- Returns:
- the index name
-
setName
Set the index name- Parameters:
name- the index name to set
-
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
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
Set the key prefix (single prefix)- Parameters:
prefix- the key prefix to set
-
setPrefix
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
Get the key separator- Returns:
- the key separator
-
setKeySeparator
Set the key separator- Parameters:
keySeparator- the key separator to set
-
getStorageType
Get the storage type- Returns:
- the storage type
-
setStorageType
Set the storage type- Parameters:
storageType- the storage type to set
-
getStopwords
Get the stopwords configuration.- Returns:
- null for default stopwords, empty list for disabled, or custom stopwords list
-
setStopwords
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
-
hashCode
public int hashCode()
-