solr_add_definite_query quotes queries

G H uothrawn at
Thu Jul 31 16:46:51 UTC 2014

So Solr 4.0 and higher supports regular expressions in searching. However, Dovecot is quoting search queries in solr_add_definite_query (via solr_add_str_arg). This breaks regex searching. I do a sample search for emails with "merged" in their body via the query /merg.*/. If you look at the Solr logs, it is sending:
which is converted to body:\"/merg.*/\" inside Solr.

but if it had sent only:

then regex would have worked.

Is regular expression searching on the dashboard? I'm considering patching fts-backend-solr.c to not quote-enclose the search, but am looking for any better suggestions. Or perhaps not quote-enclose if the search is prefixed with RX: (ie: "RX:/merg.*/")...


More information about the dovecot mailing list