We have had a request from our Solr-expert, to not send any commit-messages to the servers.

This is due to the fact that the autoCommit-policy has been configured to handle this within a reasonable time, and manual commits will hurt performance.

It would be a very helpful feature if it was possible to disable committing on a specific server.

Comments

mian3010 created an issue. See original summary.

mian3010’s picture

StatusFileSize
new550 bytes

Attached intermediate solution. The proper solution would possibly be adding a configuration on the server, for whether or not committing should be enabled.

drunken monkey’s picture

Status: Active » Needs work

Having a configuration setting for this (probably even "always"/"auto"/"never") would probably be the proper solution, but I guess this is better than nothing. However, for me to commit this, it would definitely need some documentation in README.txt and proper handling at module uninstallation. I'd also call the variable search_api_solr_commits_disabled and invert the logic. Finally, it's "altogether", with one L.
But apart from that, I'd commit this. Thanks a lot for posting it!

jts86’s picture

StatusFileSize
new1.57 KB

I've added a configuration option for commits and updated the approach of the prior patch to use it. Hope it helps.

drunken monkey’s picture

--- a/includes/service.inc
+++ b/includes/service.inc
@@ -2353,6 +2360,10 @@ class SearchApiSolrService extends SearchApiAbstractService {
   public function commit() {
+    // If committing has been disabled altogether, do nothing here.
+    if ($this->options['commits_disabled']) {
+      return;
+    }

This would lead to warnings for existing (unedited) servers – you have to surround the check with !empty().

Also, I don't think speaking of "commit messages" is very clean. This makes me think of Git (or VCS in general) and wonder what this has to do with Solr. "Disable explicit committing" would be clearer, I think. Or maybe "commit commands".

Other than that this looks good, thanks!

jts86’s picture

StatusFileSize
new1.59 KB

Yeah, you're right. Fixed!

  • drunken monkey committed 41548c8 on 7.x-1.x authored by jts86
    Issue #2677912 by jts86, mian3010: Added option to disable committing...
drunken monkey’s picture

Status: Needs work » Fixed

Looks great, thanks!
Committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.