Skip to content

Commit

Permalink
If configured as AND build explicit search query
Browse files Browse the repository at this point in the history
  • Loading branch information
cradeck committed Jul 27, 2023
1 parent e80879b commit a322ea0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Classes/Service/SolrServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -1253,6 +1253,15 @@ protected function queryComponentsForQueryParameters(array $queryParameters): ar
}
}

if($fieldInfo['and'] == '1') {
$queryPart = $magicFieldPrefix;

preg_match_all('/"(?:\\\\.|[^\\\\"])*"|\S+/', $queryTerms[0], $matches);
foreach($matches[0] as $match) {
$queryPart .= $fieldID.':'.$match.' ';
}
}

if ('' !== $queryPart && '0' !== $queryPart) {
$queryComponents[$fieldID] = $queryPart;
}
Expand Down

0 comments on commit a322ea0

Please sign in to comment.