ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

Index

  • Summary
  • Discussion
  • Properties
  • Code sample

Summary

The Index object contains information about an index on a table. There are two types of indexes: spatial and attribute. Spatial indexes exist on the shape field of a feature class.

Discussion

Index objects cannot be created directly. Index objects can accessed through the ListIndexes and Describe functions.

Properties

PropertyExplanationData Type
fields
(Read Only)

A Python List of field objects for the index.

Field
isAscending
(Read Only)

The isAscending state: True if the index is sorted in ascending order.

Boolean
isUnique
(Read Only)

The isUnique state: True if the index is unique.

Boolean
name
(Read Only)

The name of the index.

String

Code sample

Index example

Display index properties for specified table.

import arcpy

feature_class = "c:/data/well.shp"

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

# Iterate through the list of indexes
for index in indexes:
    # Print index properties
    print("Name: {0}".format(index.name))
    print("\tType            : {0}".format(index.isAscending))
    print("\tScale           : {0}".format(index.isUnique))
    print("\tNumber of fields: {0}".format(len(index.fields)))

Related topics

  • Using fields and indexes

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2021 Esri. | Privacy | Legal