Skip to content

Commit

Permalink
fix: search for LS50 for example, KEF LS50 also working
Browse files Browse the repository at this point in the history
  • Loading branch information
pierreaubert committed Nov 10, 2021
1 parent 2e02558 commit 950940e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/website/assets/search.js
Expand Up @@ -154,6 +154,7 @@ $(document).ready(function () {

function display_search(resultdiv, sorted_meta, results, filter) {
// console.log("---------- display search start ----------------");
let keywords = $("#searchInput").val();
if (results.length === 0) {
display_filter(resultdiv, sorted_meta, filter);
return;
Expand Down Expand Up @@ -183,8 +184,9 @@ $(document).ready(function () {
}
if (show) {
if (minScore < Math.pow(10, -15)) {
let is_exact = item_meta.model.toLowerCase().includes(keywords.toLowerCase());
// we have an exact match, only show other exact matches
if (score >= Math.pow(10, -15)) {
if (score >= Math.pow(10, -15) && !is_exact) {
// console.log("filtered out (minscore)" + score);
show = false;
}
Expand Down

0 comments on commit 950940e

Please sign in to comment.