Skip to content

Commit

Permalink
Use simpler grouping instead of nested/sub queries.
Browse files Browse the repository at this point in the history
Something of an oversight on my part, for missing this ability.
  • Loading branch information
adam-vessey committed Oct 28, 2011
1 parent 25a495e commit c11c332
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions IslandoraSolrResults.inc
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ EOT;

function _add_field(&$form, &$i, &$unprocessed_contents, &$types) {
$type = NULL;
$temp = preg_split('/:/', trim($unprocessed_contents, '()'), 2);
$temp = preg_split('/:/', $unprocessed_contents, 2);

if (!isset($type)) {
if (trim($temp[0]) === '_query_') {
Expand All @@ -495,7 +495,7 @@ EOT;
}
else {
$type = $temp[0];
$terms = trim($temp[1]);
$terms = trim($temp[1], '()');
}
}

Expand Down
8 changes: 7 additions & 1 deletion islandora_solr_search.module
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,13 @@ function islandora_solr_search_block_form_submit($form, &$form_state) {
}

for ($iteration = 0; $iteration < count($fedora_terms); $iteration++) {
$searchString .= "_query_:\"{!dismax qf=" . $types[$iteration] . "}" . addcslashes($fedora_terms[$iteration], "\"'") . "\" " . $booleans[$iteration] . " ";
//FIXME (minor): t() should be changed to format_string() in this instance, in Drupal 7
// The string isn't really translatable, just templated.
$searchString .= t("!field:(!query) !bool ", array(
'!field' => $types[$iteration],
'!query' => $fedora_terms[$iteration],
'!bool' => $booleans[$iteration]
));
}
$searchString = trim($searchString);
$searchString = drupal_urlencode($searchString);
Expand Down

0 comments on commit c11c332

Please sign in to comment.