From c686b20edfa44bc5e10def976194d5e62bccad5d Mon Sep 17 00:00:00 2001 From: Kyle Huynh <7862086+kylehuynh205@users.noreply.github.com> Date: Thu, 14 Mar 2024 14:16:33 -0400 Subject: [PATCH] Fixed for https://github.com/digitalutsc/advanced_search/issues/4 --- src/AdvancedSearchQueryTerm.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/AdvancedSearchQueryTerm.php b/src/AdvancedSearchQueryTerm.php index 17bb2c0..586fa5b 100644 --- a/src/AdvancedSearchQueryTerm.php +++ b/src/AdvancedSearchQueryTerm.php @@ -320,6 +320,14 @@ public function toSolrQuery(array $solr_field_mapping) { $value = str_replace('"', "", trim($value)); } } + // Fixed for https://github.com/digitalutsc/advanced_search/issues/4 + if ($this->field !== "all"){ + $search_fields = ""; + foreach ($solr_field_mapping[$this->field] as $field) { + $search_fields .= " $field:$value"; + } + return $search_fields; + } return $value; } else {