mirror of
https://github.com/YGGverse/Yo.git
synced 2025-03-13 05:41:18 +00:00
add field_weights configuration
This commit is contained in:
parent
aee9fdadb8
commit
96397b29d6
@ -42,6 +42,17 @@
|
|||||||
"extended":
|
"extended":
|
||||||
{
|
{
|
||||||
"enabled":false
|
"enabled":false
|
||||||
|
},
|
||||||
|
"options":
|
||||||
|
{
|
||||||
|
"field_weights":
|
||||||
|
{
|
||||||
|
"url": 100,
|
||||||
|
"title": 200,
|
||||||
|
"description": 300,
|
||||||
|
"keywords": 400,
|
||||||
|
"body": 500
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"footer":
|
"footer":
|
||||||
|
@ -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
|
// Get found
|
||||||
$found = empty($q) ? $total : $query->get()->getTotal();
|
$found = empty($q) ? $total : $query->get()->getTotal();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user