Skip to content

Commit

Permalink
Fix for embedding search without v1/v2 prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
DominikDoom committed Jan 1, 2023
1 parent 6deefda commit 454c13e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions javascript/tagAutocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -835,8 +835,10 @@ async function autocomplete(textArea, prompt, fixedTag = null) {
versionString = searchTerm.slice(0, 2);
searchTerm = searchTerm.slice(2);
}
let versionCondition = x => x[1] && x[1] === versionString;
tempResults = embeddings.filter(x => x[0].toLowerCase().includes(searchTerm) && versionCondition(x)); // Filter by tagword
if (versionString)
tempResults = embeddings.filter(x => x[0].toLowerCase().includes(searchTerm) && x[1] && x[1] === versionString); // Filter by tagword
else
tempResults = embeddings.filter(x => x[0].toLowerCase().includes(searchTerm)); // Filter by tagword
} else {
tempResults = embeddings;
}
Expand Down

0 comments on commit 454c13e

Please sign in to comment.