public abstract class Index extends JsonSerializable
Modifier and Type | Method and Description |
---|---|
static HashIndex |
hash(DataType dataType)
Returns an instance of HashIndex class with specified DataType.
|
static HashIndex |
hash(DataType dataType,
int precision)
Returns an instance of HashIndex class with specified DataType and precision.
|
protected void |
populatePropertyBag() |
static RangeIndex |
range(DataType dataType)
Returns an instance of RangeIndex class with specified DataType.
|
static RangeIndex |
range(DataType dataType,
int precision)
Returns an instance of RangeIndex class with specified DataType and precision.
|
static SpatialIndex |
spatial(DataType dataType)
Returns an instance of SpatialIndex class with specified DataType.
|
get, getBoolean, getCollection, getDouble, getInt, getList, getLogger, getLong, getMap, getObject, getObjectByPath, getPropertyBag, getString, has, remove, serializeJsonToByteBuffer, set, toJson, toJson, toObject, toString
public static RangeIndex range(DataType dataType)
Here is an example to create RangeIndex instance passing in the DataType:
RangeIndex rangeIndex = Index.range(DataType.NUMBER);
dataType
- the data type.public static RangeIndex range(DataType dataType, int precision)
Here is an example to create RangeIndex instance passing in the DataType and precision:
RangeIndex rangeIndex = Index.RANGE(DataType.NUMBER, -1);
dataType
- specifies the target data type for the index path specification.precision
- specifies the precision to be used for the data type associated with this index.public static HashIndex hash(DataType dataType)
Here is an example to create HashIndex instance passing in the DataType:
HashIndex hashIndex = Index.HASH(DataType.STRING);
dataType
- specifies the target data type for the index path specification.public static HashIndex hash(DataType dataType, int precision)
Here is an example to create HashIndex instance passing in the DataType and precision:
HashIndex hashIndex = Index.HASH(DataType.STRING, 3);
dataType
- specifies the target data type for the index path specification.precision
- specifies the precision to be used for the data type associated with this index.public static SpatialIndex spatial(DataType dataType)
Here is an example to create SpatialIndex instance passing in the DataType:
SpatialIndex spatialIndex = Index.SPATIAL(DataType.POINT);
dataType
- specifies the target data type for the index path specification.protected void populatePropertyBag()
populatePropertyBag
in class JsonSerializable
Copyright © 2020 Microsoft Corporation. All rights reserved.