You can send SearchResult using ResponseObject.
function search(query, res) { // res is a Response object
const searchResult = {
id: 'identifier',
payload: {},
title: 'Hello, World',
desc: 'Goodbye',
group: 'Hello'
};
res.add(searchResult);
}