Commit 0b10467b authored by Gabriela Bittencourt's avatar Gabriela Bittencourt
Browse files

Add path importance to the ranking criteria

Core documentation (inside pd-l2ork/doc/...) should be ranked before
external libraries. Add a multiplier to increase the score of files
inside that folder.
parent feea8f97
......@@ -865,6 +865,13 @@ function doc_search() {
description: {boost: 1}
}
});
// Increase priority of pd-l2ork docs over externals docs
for (i = 0; i < results.length; i++) {
if (results[i].ref.match(/.*\/pd-l2ork\/doc\/.*/) != null) {
results[i].score *= 5;
}
}
results.sort(function(a, b) { return b.score - a.score; });
for (i = 0; i < results.length; i++) {
doc = index.documentStore.getDoc(results[i].ref);
display_doc(doc);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment