manticoresoftware / manticoresoftware/manticoresearch
index_zones vs html_index_attrs
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 12k
- Forks
- 642
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 47
Description
It looks like index_zones disables html_index_attrs and it may be 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)
At first glance it's not clear if it's a bug or not. The task is to figure it out.
Once done please update https://forum.manticoresearch.com/t/how-to-filter-on-data-indexed-using-html-index-attrs-setting/734/8
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the SQL examples comparing index_zones with html_index_attrs and without index_zones. Determine whether attribute values such as href1 and href2 are intended to remain searchable inside the zone, then document the conclusion and update the linked Manticore forum discussion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, sql
- Domain
- databases, search
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100