From 0a9d02bd3b6e092967910faa23299a2bb0b21fa4 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Wed, 17 Jun 2009 12:44:33 -0400 Subject: [PATCH] solr: Don't use "any" copyfield, it doubles the index size. --HG-- branch : HEAD --- doc/solr-schema.xml | 3 --- src/plugins/fts-solr/fts-backend-solr.c | 9 +++++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/doc/solr-schema.xml b/doc/solr-schema.xml index a3ccaec3bc..923900adbd 100644 --- a/doc/solr-schema.xml +++ b/doc/solr-schema.xml @@ -50,9 +50,6 @@ want to modify the tokenizers and filters. - - - id any diff --git a/src/plugins/fts-solr/fts-backend-solr.c b/src/plugins/fts-solr/fts-backend-solr.c index 867ba09a2b..3b3ed4b4e6 100644 --- a/src/plugins/fts-solr/fts-backend-solr.c +++ b/src/plugins/fts-solr/fts-backend-solr.c @@ -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 -- 2.47.3