Index

Summary

The Index object contains information about an index on a table or feature class.

Discussion

An Index object cannot be created directly. Access Index objects using the ListIndexes or Describe functions.

Properties

PropertyExplanationData Type
fields
(Read Only)

A list of Field objects for the index.

Field
isAscending
(Read Only)

Specifies whether the index will be in ascending order.

Boolean
isFullText
(Read Only)

Specifies whether the index is a full-text index.

Boolean
isUnique
(Read Only)

Specifies whether the index is a unique index.

Boolean
name
(Read Only)

The name of the index.

String

Code sample

Index example

Display index properties for a specified table.

import arcpy

feature_class = r"c:\data.gdb\wells"

# Create a list of indexes using the ListIndexes function
indexes = arcpy.ListIndexes(feature_class)

# Iterate through the indexes
for index in indexes:
    # Print index properties
    print(f"Name: {index.name}"
    print("\tAscending index  : {index.isAscending}")
    print("\tUnique index     : {index.isUnique}")
    print("\tFull-text index  : {index.isFullText}")
    print("\tNumber of fields : {len(index.fields)}\n")

Related topics