A post on the MySQL forums caught my eye today. The distilled question was why was an index not being used to search JSON data. The poster (in blue) had done most of the steps needed almost correctly but just missed the crucial steps.
Suppose we have this table with an index on a virtual generated column as JSON attribute index pattern
CREATE TABLE applications (
id BINARY(16) PRIMARY KEY,
data JSON NOT NULL,
CREATE INDEX idx ON applications ((CAST(data->>"$.name" AS CHAR(10))));