public final class IndexingPolicy extends JsonSerializable
Constructor and Description |
---|
IndexingPolicy()
Constructor.
|
IndexingPolicy(Index[] defaultIndexOverrides)
Initializes a new instance of the IndexingPolicy class with the specified set of indexes as
default index specifications for the root path.
|
Modifier and Type | Method and Description |
---|---|
Boolean |
automatic()
Gets whether automatic indexing is enabled for a collection.
|
IndexingPolicy |
automatic(boolean automatic)
Sets whether automatic indexing is enabled for a collection.
|
List<List<CompositePath>> |
compositeIndexes()
Gets the composite indexes for additional indexes.
|
IndexingPolicy |
compositeIndexes(List<List<CompositePath>> compositeIndexes)
Sets the composite indexes for additional indexes.
|
List<ExcludedPath> |
excludedPaths()
Gets the paths that are not indexed.
|
IndexingPolicy |
excludedPaths(List<ExcludedPath> excludedPaths) |
List<IncludedPath> |
includedPaths()
Gets the paths that are chosen to be indexed by the user.
|
IndexingMode |
indexingMode()
Gets the indexing mode (consistent or lazy).
|
IndexingPolicy |
indexingMode(IndexingMode indexingMode)
Sets the indexing mode (consistent or lazy).
|
void |
setIncludedPaths(List<IncludedPath> includedPaths) |
List<SpatialSpec> |
spatialIndexes()
Sets the spatial indexes for additional indexes.
|
IndexingPolicy |
spatialIndexes(List<SpatialSpec> spatialIndexes)
Sets the spatial indexes for additional indexes.
|
get, getBoolean, getCollection, getDouble, getInt, getList, getLogger, getLong, getMap, getObject, getObjectByPath, getString, has, toJson, toJson, toObject, toString
public IndexingPolicy()
public IndexingPolicy(Index[] defaultIndexOverrides)
The following example shows how to override the default indexingPolicy for root path:
HashIndex hashIndexOverride = Index.HASH(DataType.STRING, 5);
RangeIndex rangeIndexOverride = Index.RANGE(DataType.NUMBER, 2);
SpatialIndex spatialIndexOverride = Index.SPATIAL(DataType.POINT);
IndexingPolicy indexingPolicy = new IndexingPolicy(hashIndexOverride, rangeIndexOverride, spatialIndexOverride);
If you would like to just override the indexingPolicy for Numbers you can specify just that:
RangeIndex rangeIndexOverride = Index.RANGE(DataType.NUMBER, 2);
IndexingPolicy indexingPolicy = new IndexingPolicy(rangeIndexOverride);
defaultIndexOverrides
- comma separated set of indexes that serve as default index specifications for the root path.public Boolean automatic()
In automatic indexing, documents can be explicitly excluded from indexing using RequestOptions. In manual indexing, documents can be explicitly included.
public IndexingPolicy automatic(boolean automatic)
In automatic indexing, documents can be explicitly excluded from indexing using RequestOptions. In manual indexing, documents can be explicitly included.
automatic
- the automaticpublic IndexingMode indexingMode()
public IndexingPolicy indexingMode(IndexingMode indexingMode)
indexingMode
- the indexing mode.public List<IncludedPath> includedPaths()
public void setIncludedPaths(List<IncludedPath> includedPaths)
public List<ExcludedPath> excludedPaths()
public IndexingPolicy excludedPaths(List<ExcludedPath> excludedPaths)
public List<List<CompositePath>> compositeIndexes()
public IndexingPolicy compositeIndexes(List<List<CompositePath>> compositeIndexes)
compositeIndexes
- the composite indexes.public List<SpatialSpec> spatialIndexes()
public IndexingPolicy spatialIndexes(List<SpatialSpec> spatialIndexes)
spatialIndexes
- the spatial indexes.Copyright © 2019. All rights reserved.