Commit dd44e70e authored by Patrick's avatar Patrick
Browse files

fixed search

parent c7ec381d
...@@ -10,8 +10,7 @@ const options = { ...@@ -10,8 +10,7 @@ const options = {
const options_paper = { const options_paper = {
includeScore: true, includeScore: true,
// Search in `author` and in `tags` array // Search in `author` and in `tags` array
keys: ["item.title", "item.keywords", keys: ["item.title", "item.keywords", "item.authors.lastName", "item.authors.firstName"
"item.author.firstName", "item.author.lastName"
] ]
} }
...@@ -35,7 +34,7 @@ function search() { ...@@ -35,7 +34,7 @@ function search() {
} }
function search_paper() { function search_paper() {
const fuse = new Fuse(stuff_paper, options); const fuse = new Fuse(stuff_paper, options_paper);
searchanswer_paper = fuse.search(document.getElementById("search-input_paper").value) searchanswer_paper = fuse.search(document.getElementById("search-input_paper").value)
var new_row = document.getElementById("cont_paper") var new_row = document.getElementById("cont_paper")
...@@ -197,8 +196,8 @@ input.addEventListener("keyup", function (event) { ...@@ -197,8 +196,8 @@ input.addEventListener("keyup", function (event) {
} }
}); });
var input = document.getElementById("search-input_paper"); var input2 = document.getElementById("search-input_paper");
input.addEventListener("keyup", function (event) { input2.addEventListener("keyup", function (event) {
if (event.keyCode === 13) { if (event.keyCode === 13) {
event.preventDefault(); event.preventDefault();
......
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