Select match result "off" by 1 (wrong doc_id)

I am facing a very strange situation:

  1. I am reading data from a MariaDB table (sphinx_data), the row is as follows:

SELECT * FROM sphinx_data WHERE id = 1387422
±--------±----------±-----------------+
| id | med_id | name |
±--------±----------±----------------+
| 1387422 | 3248874 | Cicatrix |
±--------±--------±---------------+

  1. I go to Manticore via mysql port (mysql -P 9306 -h 0)
    and run the following commands:

MySQL [(none)]> SELECT id,med_id,name,weight() FROM myHB_index1 WHERE id = 1387422;
±--------±--------±-------±---------+
| id | med_id | name | weight() |
±--------±--------±-------±---------+
| 1387422 | 3248873 | ZAMENE | 1 |
±--------±--------±-------±---------+

MySQL [(none)]> SELECT id,med_id,name,weight() FROM myHB_index1 WHERE id = 1387423;
±--------±--------±---------±---------+
| id | med_id | name | weight() |
±--------±--------±---------±---------+
| 1387423 | 3248874 | Cicatrix | 1 |
±--------±--------±---------±---------+

It seems like the document ID is associated to the wrong set of attributes:

Further test:

MySQL [(none)]> SELECT id,med_id,name,weight() FROM myHB_index1 WHERE MATCH (‘@name cicatrix’);
±--------±--------±---------------------------------------------------------------------------±---------+
| id | med_id | name | weight() |
±--------±--------±---------------------------------------------------------------------------±---------+
| 1387422 | 3248873 | ZAMENE | 1797 |
±--------±--------±---------------------------------------------------------------------------±---------+

indextool --dumphitlist myHB_index1 Cicatrix
Manticore 3.4.2 6903305@200410 release
Copyright (c) 2001-2016, Andrew Aksyonoff
Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)
Copyright (c) 2017-2020, Manticore Software LTD (http://manticoresearch.com)

using config file ‘/etc/manticoresearch/manticore.conf’…
dumping hitlist for index ‘myHB_index1’ keyword ‘Cicatrix’…
keyword=Cicatrix, tok=cicatrix, wordid=1452535835
doc=1387421, hit=0x06800001
doc=1387421, hit=0x08000001
doc=1387421, hit=0x15000001

To me it looks like:
The doc_id is imported correctly into Manticore, the index finds the correct document but the attributes are “off” by 1.

The very strange thing is that this happens only for some records.

I would like to check the association doc_id → attributes to see what values are in fact stored in the index files (and check if this error is caused by mysql or by the indexer).

Is there a way to dump the attributes for a given doc-id in a readable format ?

med_id is defined in the conf file as :

sql_attr_uint = med_id

I hope some of the above makes some sense, basically I am trying to verify if the attributes associated to a document are correct by dumping their values outside of mysql.

Thanks
Roberto

could you create ticket at Github where provide reproducible example (config and DB dump)?