An index could be built on top of this though if desired. No need to have it in the FS itself.
But then there's no point in storing anything in xattrs.
The reason would be that it's there as the source of truth, and when files e.g. get copied around, so does the metadata. The indexer doesn't need to be synchronous wrt such operations though, it can just watch the FS for changes and spin up reindexing as needed asynchronously.