html_search_scorer example

19 views
Skip to first unread message

Sadiq Khoja

unread,
Sep 29, 2023, 11:25:18 PMSep 29
to sphinx-users
Can somebody share email of how html_search_scorer file should look like? I have added following but this doesn't seem to work:

var Scorer = {
// Implement the following function to further tweak the score for each result
// The function takes a result array [docname, title, anchor, descr, score, filename]
// and returns the new score.
/*
score: result => {
const [docname, title, anchor, descr, score, filename] = result
return score
},
*/

// query matches the full name of an object
objNameMatch: 11,
// or matches in the last dotted part of the object name
objPartialMatch: 6,
// Additive scores depending on the priority of the object
objPrio: {
0: 15, // used to be importantResults
1: 5, // used to be objectResults
2: -5, // used to be unimportantResults
},
// Used when the priority is not in the mapping.
objPrioDefault: 0,

// query found in title
title: 50,
partialTitle: 7,
// query found in terms
term: 5,
partialTerm: 2,
};

Reply all
Reply to author
Forward
0 new messages