Add Lucene Search

This commit is contained in:
Kyle Huynh 2021-09-16 17:42:30 -04:00
parent 5b06be16f1
commit 2afe41ce79
4 changed files with 91 additions and 3 deletions

View file

@ -103,6 +103,26 @@ class AdvancedSearchForm extends FormBase {
return self::getConfig(SettingsForm::SEARCH_REMOVE_OPERATOR, self::DEFAULT_REMOVE_OP);
}
/**
* Get if Lucene Search checkbox is enabled or disable
*
* @return boolean
*
*/
public static function getLuceneSearch() {
return self::getConfig(SettingsForm::LUCENE_SEARCH_FLAG, 0);
}
/**
* Get the character to use for removing a facet from the query.
*
* @return string
* The character to use for removing an facet to the query.
*/
public static function getLuceneSearchLabel() {
return self::getConfig(SettingsForm::LUCENE_SEARCH_LABEL, "All");
}
/**
* Convert the list of fields to select options.
*
@ -243,7 +263,7 @@ class AdvancedSearchForm extends FormBase {
],
];
$options = $this->fieldOptions($fields);
$options = (self::getLuceneSearch()) ? ["all" => self::getLuceneSearchLabel()] + $this->fieldOptions($fields) : $this->fieldOptions($fields);
$term_default_values = $this->defaultTermValues($options);
list($recursive, $term_values) = $this->processInput($form_state, $term_default_values);
$i = 0;