add field_weights configuration

This commit is contained in:
yggverse 2024-03-21 22:05:47 +02:00
parent aee9fdadb8
commit 96397b29d6
2 changed files with 31 additions and 0 deletions

View file

@ -177,6 +177,26 @@ switch (true)
}
}
// Apply search options (e.g. field_weights)
foreach ($config->webui->search->options as $key => $value)
{
if (is_int($value) || is_string($value))
{
$query->option(
$key,
$value
);
}
else
{
$query->option(
$key,
(array) $value
);
}
}
// Get found
$found = empty($q) ? $total : $query->get()->getTotal();