Class IndexingPolicy

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

public final class IndexingPolicy extends Object
Represents the indexing policy configuration for a container in the Azure Cosmos DB database service.
  • Constructor Details

    • IndexingPolicy

      public IndexingPolicy()
      Constructor.
  • Method Details

    • 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.
    • getIndexingMode

      public IndexingMode getIndexingMode()
      Gets the indexing mode (consistent or lazy).
      Returns:
      the indexing mode.
    • setIndexingMode

      public IndexingPolicy setIndexingMode(IndexingMode indexingMode)
      Sets the indexing mode (consistent or lazy).
      Parameters:
      indexingMode - the indexing mode.
      Returns:
      the Indexing Policy.
    • getIncludedPaths

      public List<IncludedPath> getIncludedPaths()
      Gets the paths that are chosen to be indexed by the user.
      Returns:
      the included paths.
    • setIncludedPaths

      public IndexingPolicy setIncludedPaths(List<IncludedPath> includedPaths)
      Sets included paths.
      Parameters:
      includedPaths - the included paths
      Returns:
      the included paths
    • getExcludedPaths

      public List<ExcludedPath> getExcludedPaths()
      Gets the paths that are not indexed.
      Returns:
      the excluded paths.
    • setExcludedPaths

      public IndexingPolicy setExcludedPaths(List<ExcludedPath> excludedPaths)
      Sets excluded paths.
      Parameters:
      excludedPaths - the excluded paths
      Returns:
      the excluded paths
    • getCompositeIndexes

      public List<List<CompositePath>> getCompositeIndexes()
      Gets the composite indexes for additional indexes.
      Returns:
      the composite indexes.
    • setCompositeIndexes

      public IndexingPolicy setCompositeIndexes(List<List<CompositePath>> compositeIndexes)
      Sets the composite indexes for additional indexes.
      Parameters:
      compositeIndexes - the composite indexes.
      Returns:
      the Indexing Policy.
    • getSpatialIndexes

      public List<SpatialSpec> getSpatialIndexes()
      Gets the spatial indexes for additional indexes.
      Returns:
      the spatial indexes.
    • setSpatialIndexes

      public IndexingPolicy setSpatialIndexes(List<SpatialSpec> spatialIndexes)
      Sets the spatial indexes for additional indexes.
      Parameters:
      spatialIndexes - the spatial indexes.
      Returns:
      the Indexing Policy.
    • getVectorIndexes

      public List<CosmosVectorIndexSpec> getVectorIndexes()
      Gets the vector indexes.
      Returns:
      the vector indexes
    • setVectorIndexes

      public IndexingPolicy setVectorIndexes(List<CosmosVectorIndexSpec> 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.