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.
|
IndexingPolicy(org.json.JSONObject jsonObject)
Constructor.
|
IndexingPolicy(String jsonString)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Boolean |
getAutomatic()
Gets whether automatic indexing is enabled for a collection.
|
Collection<ExcludedPath> |
getExcludedPaths()
Gets the paths that are not indexed.
|
Collection<IncludedPath> |
getIncludedPaths()
Gets the paths that are chosen to be indexed by the user.
|
IndexingMode |
getIndexingMode()
Gets the indexing mode (consistent or lazy).
|
void |
setAutomatic(boolean automatic)
Sets whether automatic indexing is enabled for a collection.
|
void |
setExcludedPaths(Collection<ExcludedPath> excludedPaths) |
void |
setIncludedPaths(Collection<IncludedPath> includedPaths) |
void |
setIndexingMode(IndexingMode indexingMode)
Sets the indexing mode (consistent or lazy).
|
get, getBoolean, getCollection, getCollection, getDouble, getHashMap, getInt, getLogger, getLong, getMapper, getObject, getObject, getObjectByPath, getString, has, remove, set, 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 IndexingPolicy(String jsonString)
jsonString
- the json string that represents the indexing policy.public IndexingPolicy(org.json.JSONObject jsonObject)
jsonObject
- the json object that represents the indexing policy.public Boolean getAutomatic()
In automatic indexing, documents can be explicitly excluded from indexing using RequestOptions. In manual indexing, documents can be explicitly included.
public void setAutomatic(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 getIndexingMode()
public void setIndexingMode(IndexingMode indexingMode)
indexingMode
- the indexing mode.public Collection<IncludedPath> getIncludedPaths()
public void setIncludedPaths(Collection<IncludedPath> includedPaths)
public Collection<ExcludedPath> getExcludedPaths()
public void setExcludedPaths(Collection<ExcludedPath> excludedPaths)
Copyright © 2018. All rights reserved.