solr_add_definite_query quotes queries

G H uothrawn at yahoo.com
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:
  q=body:"/merg.*/"
which is converted to body:\"/merg.*/\" inside Solr.


but if it had sent only:
  q=body:/merg.*/


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.*/")...


Thanks,
G H



More information about the dovecot mailing list