Class HashIndex


  • public final class HashIndex
    extends Index
    Represents a hash index in the Azure Cosmos DB database service.
    • Constructor Detail

      • HashIndex

        public HashIndex​(DataType dataType)
        Specifies an instance of HashIndex class with specified DataType.

        Here is an example to instantiate HashIndex class passing in the DataType:

         
        
         HashIndex hashIndex = new HashIndex(DataType.STRING);
        
         
         
        Parameters:
        dataType - the data type.
      • HashIndex

        public HashIndex​(DataType dataType,
                         int precision)
        Initializes a new instance of the HashIndex class with specified DataType and precision.

        Here is an example to instantiate HashIndex class passing in the DataType:

         
        
         HashIndex hashIndex = new HashIndex(DataType.STRING, 3);
        
         
         
        Parameters:
        dataType - the data type.
        precision - the precision.
    • Method Detail

      • dataType

        public DataType dataType()
        Gets data type.
        Returns:
        the data type.
      • dataType

        public HashIndex dataType​(DataType dataType)
        Sets data type.
        Parameters:
        dataType - the data type.
        Returns:
        the Hash Index.
      • precision

        public int precision()
        Gets precision.
        Returns:
        the precision.
      • precision

        public HashIndex precision​(int precision)
        Sets precision.
        Parameters:
        precision - the precision.
        Returns:
        the Hash Index.