mirror of
https://github.com/vale981/Vulcan
synced 2025-03-07 02:21:43 -05:00
18 lines
No EOL
652 B
JavaScript
18 lines
No EOL
652 B
JavaScript
function addSearchQueryParameter (parameters, terms) {
|
|
if(!!terms.query) {
|
|
var parameters = Telescope.utils.deepExtend(true, parameters, {
|
|
selector: {
|
|
$or: [
|
|
{title: {$regex: terms.query, $options: 'i'}},
|
|
{url: {$regex: terms.query, $options: 'i'}},
|
|
// note: we cannot search the body field because it's not published
|
|
// to the client. If we did, we'd get different result sets on
|
|
// client and server
|
|
{excerpt: {$regex: terms.query, $options: 'i'}}
|
|
]
|
|
}
|
|
});
|
|
}
|
|
return parameters;
|
|
}
|
|
Telescope.callbacks.add("postsParameters", addSearchQueryParameter); |