Skip to content

Commit

Permalink
MDL-68726 Search: Stop Solr 'optimize' behaviour
Browse files Browse the repository at this point in the history
The optimize feature in Solr is usually considered harmful, especially
prior to Solr 7.5.

This change simply removes the optimize implementation from the Solr
engine.
  • Loading branch information
sammarshallou committed Jul 17, 2020
1 parent 741d6dd commit 9b36464
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
2 changes: 2 additions & 0 deletions search/classes/engine.php
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,8 @@ public function area_index_complete($searcharea, $numdocs = 0, $fullindex = fals
*/
public function optimize() {
// Nothing by default.
mtrace('The ' . get_string('pluginname', $this->get_plugin_name()) .
' search engine does not require automatic optimization.');
}

/**
Expand Down
9 changes: 0 additions & 9 deletions search/engine/solr/classes/engine.php
Original file line number Diff line number Diff line change
Expand Up @@ -1203,15 +1203,6 @@ public function file_indexing_enabled() {
return (bool)$this->config->fileindexing;
}

/**
* Defragments the index.
*
* @return void
*/
public function optimize() {
$this->get_search_client()->optimize(1, true, false);
}

/**
* Deletes the specified document.
*
Expand Down

0 comments on commit 9b36464

Please sign in to comment.