acrn-hypervisor/doc/scorer.js
David B. Kinder 5fecb71617 doc: update release_3.0 with changes on master
For the 3.0.1 hot-fix release, update release_3.0 branch with doc
changes relevent updates since v3.0 tag.  This is primarily for the
doc/asa.rst and doc/release_notes/release_notes_3.0.1.rst files, but
there was also a cleanup of deleted image files, and some changes made
for copyright years.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2022-07-28 08:16:54 -07:00

49 lines
1.3 KiB
JavaScript

/**
* Simple search result scoring code.
*
* Copyright 2007-2018 by the Sphinx team
* Copyright (c) 2019-2022, Intel Corporation.
* SPDX-License-Identifier: Apache-2.0
*/
var Scorer = {
// Implement the following function to further tweak the score for
// each result The function takes a result array [filename, title,
// anchor, descr, score] and returns the new score.
// For ACRN search results, push display down for release_notes and
// api docs so "regular" docs will show up before them
score: function(result) {
if (result[0].search("release_notes/")>=0) {
return -6;
}
else if (result[0].search("api/")>=0) {
return -5;
}
else if (result[0].search("kconfig/")>=0) {
return -5;
}
else {
return result[4];
}
},
// 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: 15,
// query found in terms
term: 5
};