Mercurial > dovecot > original-hg > dovecot-1.2
comparison src/plugins/fts-solr/fts-backend-solr.c @ 8002:e814614ffb65 HEAD
fts-solr: Added break-imap-search setting to use Solr with SEARCH TEXT/BODY
parameters. This makes the SEARCH non-compliant with standard IMAP protocol,
because TEXT/BODY require support for substring searches and Lucene doesn't
support them.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sun, 13 Jul 2008 15:15:04 +0300 |
parents | 3fbfdda3e5d3 |
children | 6418d4c0ff16 |
comparison
equal
deleted
inserted
replaced
8001:3fbfdda3e5d3 | 8002:e814614ffb65 |
---|---|
5 #include "str.h" | 5 #include "str.h" |
6 #include "mail-storage-private.h" | 6 #include "mail-storage-private.h" |
7 #include "solr-connection.h" | 7 #include "solr-connection.h" |
8 #include "fts-solr-plugin.h" | 8 #include "fts-solr-plugin.h" |
9 | 9 |
10 #include <stdlib.h> | |
11 #include <curl/curl.h> | 10 #include <curl/curl.h> |
12 | 11 |
13 #define SOLR_CMDBUF_SIZE (1024*64) | 12 #define SOLR_CMDBUF_SIZE (1024*64) |
14 | 13 |
15 struct solr_fts_backend_build_context { | 14 struct solr_fts_backend_build_context { |
57 } | 56 } |
58 | 57 |
59 static struct fts_backend * | 58 static struct fts_backend * |
60 fts_backend_solr_init(struct mailbox *box ATTR_UNUSED) | 59 fts_backend_solr_init(struct mailbox *box ATTR_UNUSED) |
61 { | 60 { |
61 const struct fts_solr_settings *set = &fts_solr_settings; | |
62 struct fts_backend *backend; | 62 struct fts_backend *backend; |
63 | 63 |
64 if (solr_conn == NULL) | 64 if (solr_conn == NULL) |
65 solr_conn = solr_connection_init(getenv("FTS_SOLR")); | 65 solr_conn = solr_connection_init(set->url, set->debug); |
66 | 66 |
67 backend = i_new(struct fts_backend, 1); | 67 backend = i_new(struct fts_backend, 1); |
68 *backend = fts_backend_solr; | 68 *backend = fts_backend_solr; |
69 | |
70 if (set->substring_search) | |
71 backend->flags |= FTS_BACKEND_FLAG_SUBSTRING_LOOKUPS; | |
69 return backend; | 72 return backend; |
70 } | 73 } |
71 | 74 |
72 static void fts_backend_solr_deinit(struct fts_backend *backend) | 75 static void fts_backend_solr_deinit(struct fts_backend *backend) |
73 { | 76 { |