How to filter on data indexed using "html_index_attrs" setting?

It looks like index_zones disables html_index_attrs and it seems wrong:

index_zones + html_index_attrs:

mysql> create table t(f text) html_strip='1' html_index_attrs='a=href' index_zones='a'; 

insert into t values(0, '<a href="href1" title="title1">a1</a> between <a href="href2">a2</a>'),(0,'<a href="href3">between</a>');

mysql> select * from t where match('href1');
Empty set (0.00 sec)

mysql> select * from t where match('ZONE:a a1');
+---------------------+----------------------------------------------------------------------+
| id                  | f                                                                    |
+---------------------+----------------------------------------------------------------------+
| 1514175226210943028 | <a href="href1" title="title1">a1</a> between <a href="href2">a2</a> |
+---------------------+----------------------------------------------------------------------+
1 row in set (0.01 sec)

mysql> select * from t where match('ZONE:a href2');
Empty set (0.00 sec)

mysql> select * from t where match('ZONE:a href1');
Empty set (0.00 sec)

I.e. there seems to be no way to find href1, href2.

Without index_zones:

mysql> create table t(f text) html_strip='1' html_index_attrs='a=href'; 

insert into t values(0, '<a href="href1" title="title1">a1</a> between <a href="href2">a2</a>'),(0,'<a href="href3">between</a>');

mysql> select * from t where match('href1');
+---------------------+----------------------------------------------------------------------+
| id                  | f                                                                    |
+---------------------+----------------------------------------------------------------------+
| 1514175226210943030 | <a href="href1" title="title1">a1</a> between <a href="href2">a2</a> |
+---------------------+----------------------------------------------------------------------+
1 row in set (0.00 sec)

It looks like a bug to me. I’ll discuss with the team to make sure I’m not missing smth.

In terms of the design: there was no idea to make it possible to index each attribute of each tag as a different full-text field so you can address each separately. As Barry said index_html_attrs just lets you not skip indexing the attributes you specify.