Hi
AGOL has no UI to create an attribute index, there is only a REST endpoint:
https://developers.arcgis.com/rest/services-reference/add-to-definition-feature-layer-.htm#example2
if you need to make queries on a key field an attribute index would speed things up.

