IndexingPolicy Class

  • java.lang.Object
    • com.azure.cosmos.models.IndexingPolicy

public final class IndexingPolicy

Represents the indexing policy configuration for a container in the Azure Cosmos DB database service.

Constructor Summary

Constructor Description
IndexingPolicy()

Constructor.

Method Summary

Modifier and Type Method and Description
List<List<CompositePath>> getCompositeIndexes()

Gets the composite indexes for additional indexes.

List<ExcludedPath> getExcludedPaths()

Gets the paths that are not indexed.

List<IncludedPath> getIncludedPaths()

Gets the paths that are chosen to be indexed by the user.

IndexingMode getIndexingMode()

Gets the indexing mode (consistent or lazy).

List<SpatialSpec> getSpatialIndexes()

Gets the spatial indexes for additional indexes.

List<CosmosVectorIndexSpec> getVectorIndexes()

Gets the vector indexes.

Boolean isAutomatic()

Gets whether automatic indexing is enabled for a container.

IndexingPolicy setAutomatic(boolean automatic)

Sets whether automatic indexing is enabled for a container.

IndexingPolicy setCompositeIndexes(List<List<CompositePath>> compositeIndexes)

Sets the composite indexes for additional indexes.

IndexingPolicy setExcludedPaths(List<ExcludedPath> excludedPaths)

Sets excluded paths.

IndexingPolicy setIncludedPaths(List<IncludedPath> includedPaths)

Sets included paths.

IndexingPolicy setIndexingMode(IndexingMode indexingMode)

Sets the indexing mode (consistent or lazy).

IndexingPolicy setSpatialIndexes(List<SpatialSpec> spatialIndexes)

Sets the spatial indexes for additional indexes.

IndexingPolicy setVectorIndexes(List<CosmosVectorIndexSpec> vectorIndexes)

Sets the vector indexes.

Methods inherited from java.lang.Object

Constructor Details

IndexingPolicy

public IndexingPolicy()

Constructor.

Method Details

getCompositeIndexes

public List> getCompositeIndexes()

Gets the composite indexes for additional indexes.

Returns:

the composite indexes.

getExcludedPaths

public List getExcludedPaths()

Gets the paths that are not indexed.

Returns:

the excluded paths.

getIncludedPaths

public List getIncludedPaths()

Gets the paths that are chosen to be indexed by the user.

Returns:

the included paths.

getIndexingMode

public IndexingMode getIndexingMode()

Gets the indexing mode (consistent or lazy).

Returns:

the indexing mode.

getSpatialIndexes

public List getSpatialIndexes()

Gets the spatial indexes for additional indexes.

Returns:

the spatial indexes.

getVectorIndexes

public List getVectorIndexes()

Gets the vector indexes.

Returns:

the vector indexes

isAutomatic

public Boolean isAutomatic()

Gets whether automatic indexing is enabled for a container.

In automatic indexing, items can be explicitly excluded from indexing using RequestOptions. In manual indexing, items can be explicitly included.

Returns:

the automatic

setAutomatic

public IndexingPolicy setAutomatic(boolean automatic)

Sets whether automatic indexing is enabled for a container.

In automatic indexing, items can be explicitly excluded from indexing using RequestOptions. In manual indexing, items can be explicitly included.

Parameters:

automatic - the automatic

Returns:

the Indexing Policy.

setCompositeIndexes

public IndexingPolicy setCompositeIndexes(List> compositeIndexes)

Sets the composite indexes for additional indexes.

Parameters:

compositeIndexes - the composite indexes.

Returns:

the Indexing Policy.

setExcludedPaths

public IndexingPolicy setExcludedPaths(List excludedPaths)

Sets excluded paths.

Parameters:

excludedPaths - the excluded paths

Returns:

the excluded paths

setIncludedPaths

public IndexingPolicy setIncludedPaths(List includedPaths)

Sets included paths.

Parameters:

includedPaths - the included paths

Returns:

the included paths

setIndexingMode

public IndexingPolicy setIndexingMode(IndexingMode indexingMode)

Sets the indexing mode (consistent or lazy).

Parameters:

indexingMode - the indexing mode.

Returns:

the Indexing Policy.

setSpatialIndexes

public IndexingPolicy setSpatialIndexes(List spatialIndexes)

Sets the spatial indexes for additional indexes.

Parameters:

spatialIndexes - the spatial indexes.

Returns:

the Indexing Policy.

setVectorIndexes

public IndexingPolicy setVectorIndexes(List vectorIndexes)

Sets the vector indexes. Example of the vectorIndexes: "vectorIndexes": [ { "path": "/vector1", "type": "diskANN" }, { "path": "/vector1", "type": "flat" }, { "path": "/vector2", "type": "quantizedFlat" }]

Parameters:

vectorIndexes - the vector indexes

Returns:

the Indexing Policy.

Applies to