Skip to content
Snippets Groups Projects
Commit 53016af8 authored by Mathias Maaß's avatar Mathias Maaß Committed by André Lahmann
Browse files

refs #23320 [finc] delete redunant code for setting shard parameters

parent 56a1745d
Branches
Tags
No related merge requests found
...@@ -60,11 +60,6 @@ class MungerInjectionDelegatorFactory implements DelegatorFactoryInterface ...@@ -60,11 +60,6 @@ class MungerInjectionDelegatorFactory implements DelegatorFactoryInterface
*/ */
protected $preMungerConfig; protected $preMungerConfig;
/**
* @var array shard configuration to register in all queries
*/
protected $shards_to_register;
/** /**
* @var array search types to be excluded from lucene query syntax detection * @var array search types to be excluded from lucene query syntax detection
*/ */
...@@ -103,14 +98,6 @@ class MungerInjectionDelegatorFactory implements DelegatorFactoryInterface ...@@ -103,14 +98,6 @@ class MungerInjectionDelegatorFactory implements DelegatorFactoryInterface
} }
); );
} }
$shards = $searchConfig->IndexShards->toArray();
if ($excludedShards = $searchConfig->ShardPreferences->on_user_search_only ?? null) {
$shards = array_diff_key($shards, array_flip(explode(',', $excludedShards)));
}
if (!empty($shards)) {
$this->shards_to_register = $shards;
$e->attach('VuFindSearch', 'pre', [$this, 'registerShards']);
}
if (isset($searchConfig->General->override_advanced_lucene_detection)) { if (isset($searchConfig->General->override_advanced_lucene_detection)) {
$this->override_advanced_lucene_detection = array_flip($searchConfig->General->override_advanced_lucene_detection->toArray()); $this->override_advanced_lucene_detection = array_flip($searchConfig->General->override_advanced_lucene_detection->toArray());
if (!empty($this->override_advanced_lucene_detection)) { if (!empty($this->override_advanced_lucene_detection)) {
...@@ -176,22 +163,6 @@ class MungerInjectionDelegatorFactory implements DelegatorFactoryInterface ...@@ -176,22 +163,6 @@ class MungerInjectionDelegatorFactory implements DelegatorFactoryInterface
return true; return true;
} }
/**
* Event Listener on Search/Pre that registers all configured shards for every
* search request
*
* @param EventInterface $event
*
* @return void
*/
public function registerShards(EventInterface $event)
{
$params = $event->getParam('params');
if (empty($params->get('shards'))) {
$params->set('shards', implode(',', $this->shards_to_register));
}
}
public function overrideLuceneSyntaxHelper(EventInterface $event) public function overrideLuceneSyntaxHelper(EventInterface $event)
{ {
$params = $event->getParams(); $params = $event->getParams();
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment