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

Reply via email to