Closed mikhailkilyakov closed 4 months ago
Hello
Just investigated strange behavior (commit = a8fa71220b2096be4a6b558ed0c85434ed6994da).
Steps to reproduce:
Index folders
Try to search using BODY, results should be present:
doveadm -Dv search -u user@domain.com BODY 'hello'
doveadm -Dv search -u user@domain.com TEXT 'hello'
The reason is in sligthly incorrect checking of passed header value (https://github.com/grosjo/fts-xapian/blob/a8fa71220b2096be4a6b558ed0c85434ed6994da/src/fts-backend-xapian-functions.cpp#L148-L156).
The specified code returns from method when no header is found in hdrs_emails. Constant XAPIAN_WILDCARD is not in the list, thus it will never process all headers (however it should when TEXT is passed).
Possible solution:
Replace line 152:
if(i>=HDRS_NB)
With this code:
if((i>=HDRS_NB) && (strcmp(h2, XAPIAN_WILDCARD)!=0))
Thanks
Indeed. Kindly check latest git
I tested it. It seems working. If not, kindly reopen the issue
Hello
Just investigated strange behavior (commit = a8fa71220b2096be4a6b558ed0c85434ed6994da).
Steps to reproduce:
Index folders
Try to search using BODY, results should be present:
doveadm -Dv search -u user@domain.com BODY 'hello'
doveadm -Dv search -u user@domain.com TEXT 'hello'
The reason is in sligthly incorrect checking of passed header value (https://github.com/grosjo/fts-xapian/blob/a8fa71220b2096be4a6b558ed0c85434ed6994da/src/fts-backend-xapian-functions.cpp#L148-L156).
The specified code returns from method when no header is found in hdrs_emails. Constant XAPIAN_WILDCARD is not in the list, thus it will never process all headers (however it should when TEXT is passed).
Possible solution:
Replace line 152:
if(i>=HDRS_NB)
With this code:
if((i>=HDRS_NB) && (strcmp(h2, XAPIAN_WILDCARD)!=0))
Thanks