search body with wildcards
Hi,
A question. We are using fts_solr. When searching for content in BODY I noticed that dovecot only supports full words. "BODY calibration" returns results but "BODY calibra" does not. Nor "BODY calibra*".
Solr does support searching with wildcards so why is it that dovecot does not?
regards,
-- Willem-Jan de Hoog
On 2016-11-09 09:52, W. de Hoog wrote:
Hi,
A question. We are using fts_solr. When searching for content in BODY I noticed that dovecot only supports full words. "BODY calibration" returns results but "BODY calibra" does not. Nor "BODY calibra*".
Solr does support searching with wildcards so why is it that dovecot does not?
When searching:
doveadm search mailbox shared/* BODY calib*
solr is queried with
...body:calib%5c*...
so the wildcard is escaped. Is there any way to disable this escaping?
regards,
-- Willem-Jan de Hoog
When searching:
doveadm search mailbox shared/* BODY calib*
solr is queried with
...body:calib%5c*...
so the wildcard is escaped. Is there any way to disable this escaping? I removed '*' and '?' from solr_escape_chars in src/plugins/fts-solr/fts-backend-solr.c to allow to use them as wildcards. I also removed '\' to allow them to be escaped so now these work:
doveadm search mailbox shared/* BODY calibrat* to find words starting with calibrat
and
doveadm search mailbox shared/* BODY calibrati\\*n to find "calibrati*n"
In my php search form I can now use "body calibrat*" and in thunderbird search dialog as well. Searching for "calibrati*n" (using "calibrati\*n") also works for php but not in Thunderbird.
One note: searching with "\*" is rather slow.
I cannot estimate the implications it has on the other search actions (TO, FROM etc) so I hope someone with more knowledge can comment.
regards,
-- Willem-Jan de Hoog
participants (1)
-
W. de Hoog