From 79aff520d009c7d61f9386507f3dde0fafca3a81 Mon Sep 17 00:00:00 2001 From: Niko Storni Date: Mon, 2 Dec 2019 19:00:53 +0100 Subject: [PATCH] hard tuning --- server/controllers/lighthouse.js | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/server/controllers/lighthouse.js b/server/controllers/lighthouse.js index 6a70229..f97f09d 100644 --- a/server/controllers/lighthouse.js +++ b/server/controllers/lighthouse.js @@ -89,16 +89,27 @@ function getResults (input) { { // The relevancy of old posts is multiplied by at least one. // Remove if you want to exclude old posts - 'weight': 1, + 'weight': 0.6, }, { // Published this week get a big boost - 'weight': 80, + 'weight': 85, 'gauss' : { 'transaction_time': { // <- Change to your date field name 'origin': Date.now(), // Change to current date 'scale' : '7d', - 'decay' : 0.5, + 'decay' : 0.6, + }, + }, + }, + { + // Published this month get a big boost + 'weight': 60, + 'gauss' : { + 'transaction_time': { // <- Change to your date field name + 'origin': Date.now(), // Change to current date + 'scale' : '31d', + 'decay' : 0.55, }, }, }, @@ -108,19 +119,19 @@ function getResults (input) { 'gauss' : { 'transaction_time': { // <- Change to your date field name 'origin': Date.now(), // Change to current date - 'scale' : '31d', + 'scale' : '62d', 'decay' : 0.5, }, }, }, { // Published this year get a boost - 'weight': 20, + 'weight': 40, 'gauss' : { 'transaction_time': { // <- Change to your date field name 'origin': Date.now(), // Change to current date 'scale' : '356d', - 'decay' : 0.5, + 'decay' : 0.2, }, }, }, @@ -576,6 +587,7 @@ class LighthouseControllers { async search (ctx) { await getResults(ctx.query).then(function (result) { let results = result.hits.hits; + console.log(results); let cResults = []; for (let pResult of results) { cResults.push(pResult._source);