Add match nr

This commit is contained in:
Stephan Porada
2020-02-03 13:59:37 +01:00
parent da766b32ca
commit ccb97d5773
2 changed files with 10 additions and 7 deletions

View File

@ -163,7 +163,8 @@
<table class="responsive-table highlight">
<thead>
<tr>
<th style="width: 5%">Title</th>
<th style="width: 2%">Nr.</th>
<th style="width: 3%">Title</th>
<th style="width: 25%">Left context</th>
<th style="width: 45%">Match</th>
<th style="width: 25%">Right Context</th>
@ -313,6 +314,7 @@
valueNames: ["titles", "lc", "hit", "rc", {data: ["index"]}],
item: `<span class="hidden"></span>`};
resultList = new ResultList('result-list', options);
resultList.clear(); // empty list for new query
});
@ -336,6 +338,7 @@
return; // no further code execution of this code block
}
// logs the current recieved chunk
chunk = {};
chunk = response["result"];
console.log("### corpus_analysis chunk ###");
console.log(chunk);
@ -363,7 +366,6 @@
// List building/appending the chunks when query had results
// write metadata query information into HTML elements
// like nr. of all matches in how many files etc.
// TODO: count_corpus_files müssen aus full results genommen werden. Ist am Ende richtig aber dazwischen zählt es hoch
match_count = chunk["match_count"];
let count_corpus_files = Object.keys(result["text_lookup"]).length;
queryResultsMetadataElement.innerHTML = chunk["match_count"] + " matches in " + count_corpus_files + " corpus files.";
@ -406,7 +408,7 @@
var currentTime = today.getUTCHours() + ":" + today.getUTCMinutes() + ":" + today.getUTCSeconds();
var safeFilename = message['query'].replace(/[^a-z0-9_-]/gi, "_");
var resultFilename = "UTC-" + currentDate + "_" + currentTime + "_" + safeFilename + ".json";
// get a where download is served
// get <a> where download is served
var downloadResults = document.getElementById("download-results");
// stringify JSON object for json download
var dataStr = JSON.stringify(message, undefined, 2);