Skip to content

Commit e3d9c87

Browse files
committed
MDL-66140 search: Mitigate PECL solr extension regression
Refs: - https://bugs.php.net/bug.php?id=72740 - https://bugs.php.net/bug.php?id=75631 - php/pecl-search_engine-solr#16
1 parent 79bd60b commit e3d9c87

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

search/engine/solr/classes/engine.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,10 @@ public function add_fields($query) {
433433
$query->addField($key);
434434
if ($dismax && !empty($field['mainquery'])) {
435435
// Add fields the main query should be run against.
436-
$query->addQueryField($key);
436+
// Due to a regression in the PECL solr extension, https://bugs.php.net/bug.php?id=72740,
437+
// a boost value is required, even if it is optional; to avoid boosting one among other fields,
438+
// the explicit boost value will be the default one, for every field.
439+
$query->addQueryField($key, 1);
437440
}
438441
}
439442
}

0 commit comments

Comments
 (0)