Authored by zhangxiaoru

search

... ... @@ -134,6 +134,7 @@ const index = (req, res, next) => {
let title = '搜索';
searchModel.getSearchIndex().then((result) => {
console.log(result.defaultTerms)
res.render('search/index', {
module: 'product',
page: 'search-index',
... ... @@ -142,9 +143,9 @@ const index = (req, res, next) => {
}),
pageFooter: true,
search: {
defaultTerms: result[0].content || '',
defaultTerms: result.defaultTerms[0].content || '',
url: helpers.urlFormat('', null, 'search'),
hotTerms: result
hotTerms: result.hotTerms
}
});
... ...
... ... @@ -223,7 +223,7 @@ const getSearchIndex = () => {
cache: true
}).then((result) => {
if (result && result.code === 200) {
return result.data.hotTerms;
return result.data;
} else {
logger.error('Hot Search return code is not 200');
return {};
... ...