ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Core.Data.DDL Namespace / AttributeIndexDescription Class / AttributeIndexDescription Constructor / AttributeIndexDescription Constructor(Index,TableDescription)
The attribute ArcGIS.Core.Data.Index that the description object is representing.
The description object representing the ArcGIS.Core.Data.Table that will hold the attribute index.
Example

In This Topic
    AttributeIndexDescription Constructor(Index,TableDescription)
    In This Topic
    Creates a description object of the attribute ArcGIS.Core.Data.Index.
    Syntax
    public AttributeIndexDescription( 
       Index attributeIndex,
       TableDescription tableDescription
    )
    Public Function New( _
       ByVal attributeIndex As Index, _
       ByVal tableDescription As TableDescription _
    )

    Parameters

    attributeIndex
    The attribute ArcGIS.Core.Data.Index that the description object is representing.
    tableDescription
    The description object representing the ArcGIS.Core.Data.Table that will hold the attribute index.
    Exceptions
    ExceptionDescription
    The list of field names is invalid.
    Example
    Creating a table with index from scratch
    public void CreatingTableWithIndex(SchemaBuilder schemaBuilder)
    {
        FieldDescription nameFieldDescription = FieldDescription.CreateStringField("Name", 50);
        FieldDescription addressFieldDescription = FieldDescription.CreateStringField("Address", 200);
    
        // Creating a feature class, 'Buildings' with two fields
        TableDescription tableDescription = new TableDescription("Buildings", new List<FieldDescription>() { nameFieldDescription, addressFieldDescription });
    
        // Enqueue DDL operation to create a table
        TableToken tableToken = schemaBuilder.Create(tableDescription);
    
        // Creating an attribute index named as 'Idx'
        AttributeIndexDescription attributeIndexDescription = new AttributeIndexDescription("Idx", new TableDescription(tableToken),
          new List<string> { nameFieldDescription.Name, addressFieldDescription.Name });
    
        // Enqueue DDL operation to create an attribute index
        schemaBuilder.Create(attributeIndexDescription);
    
        // Execute build indexes operation
        bool isBuildSuccess = schemaBuilder.Build();
    }
    Removing attribute index
    public void RemoveAttributeIndex(SchemaBuilder schemaBuilder, FeatureClassDefinition featureClassDefinition, string attributeIndexName)
    {
        // Find a index to be removed 
        ArcGIS.Core.Data.Index indexToRemove = featureClassDefinition.GetIndexes().First(f => f.GetName().Equals(attributeIndexName));
    
        // Index description of the index to be removed 
        AttributeIndexDescription indexDescriptionToRemove = new AttributeIndexDescription(indexToRemove, new TableDescription(featureClassDefinition));
    
        // Enqueue the DDL operation to remove index 
        schemaBuilder.Delete(indexDescriptionToRemove);
    
        // Execute the delete index operation
        bool isDeleteIndexSuccess = schemaBuilder.Build();
    }
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.1 or higher.
    See Also