]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
solr: Don't use "any" copyfield, it doubles the index size.
authorTimo Sirainen <tss@iki.fi>
Wed, 17 Jun 2009 16:44:33 +0000 (12:44 -0400)
committerTimo Sirainen <tss@iki.fi>
Wed, 17 Jun 2009 16:44:33 +0000 (12:44 -0400)
--HG--
branch : HEAD

doc/solr-schema.xml
src/plugins/fts-solr/fts-backend-solr.c

index a3ccaec3bcfe9d9669b260cf2237fa9d6dbe3722..923900adbd6a5c572670069560b94e2a258933bb 100644 (file)
@@ -50,9 +50,6 @@ want to modify the tokenizers and filters.
    <field name="any" type="text" indexed="true" stored="false" multiValued="true" />
  </fields>
 
- <copyField source="hdr" dest="any" />
- <copyField source="body" dest="any" />
-
  <uniqueKey>id</uniqueKey>
  <defaultSearchField>any</defaultSearchField>
  <solrQueryParser defaultOperator="AND" />
index 867ba09a2bcc7c3b512699912bff966bb1c82f7a..3b3ed4b4e6bd384ebd1dd315a7d238b973ee8f46 100644 (file)
@@ -752,14 +752,19 @@ static int fts_backend_solr_lookup(struct fts_backend_lookup_context *ctx,
                        /* body only */
                        i_assert((fields[i].flags & FTS_LOOKUP_FLAG_BODY) != 0);
                        str_append(str, "body:");
+                       solr_quote_http(str, fields[i].key);
                } else if ((fields[i].flags & FTS_LOOKUP_FLAG_BODY) == 0) {
                        /* header only */
                        str_append(str, "hdr:");
+                       solr_quote_http(str, fields[i].key);
                } else {
                        /* both */
-                       str_append(str, "any:");
+                       str_append(str, "(body:");
+                       solr_quote_http(str, fields[i].key);
+                       str_append(str, "+OR+hdr:");
+                       solr_quote_http(str, fields[i].key);
+                       str_append_c(str, ')');
                }
-               solr_quote_http(str, fields[i].key);
        }
 
        /* use a separate filter query for selecting the mailbox. it shouldn't