visible to the following search */
if (ctx->expunges)
fts_backend_solr_expunge_flush(ctx);
- str = t_strdup_printf("<commit softCommit=\"true\" waitSearcher=\"%s\"/>",
- ctx->documents_added ? "true" : "false");
- if (solr_connection_post(backend->solr_conn, str) < 0)
- ret = -1;
+ if (fuser->set.soft_commit) {
+ str = t_strdup_printf("<commit softCommit=\"true\" waitSearcher=\"%s\"/>",
+ ctx->documents_added ? "true" : "false");
+ if (solr_connection_post(backend->solr_conn, str) < 0)
+ ret = -1;
+ }
}
str_free(&ctx->cmd);
str = "";
set->batch_size = DEFAULT_SOLR_BATCH_SIZE;
+ set->soft_commit = TRUE;
for (tmp = t_strsplit_spaces(str, " "); *tmp != NULL; tmp++) {
if (str_begins(*tmp, "url=")) {
i_error("fts_solr: batch_size must be a positive integer");
return -1;
}
+ } else if (str_begins(*tmp, "soft_commit=")) {
+ if (strcmp(*tmp + 12, "yes") == 0) {
+ set->soft_commit = TRUE;
+ } else if (strcmp(*tmp + 12, "no") == 0) {
+ set->soft_commit = FALSE;
+ } else {
+ i_error("fts_solr: Invalid setting for soft_commit: %s", *tmp+12);
+ return -1;
+ }
} else {
i_error("fts_solr: Invalid setting: %s", *tmp);
return -1;