1
0
mirror of https://github.com/c9fe/22120.git synced 2024-11-13 22:42:34 +01:00

"Updating Id at start as function of Index size."

This commit is contained in:
Cris Stringfellow 2021-12-17 22:19:36 +08:00
parent ffcf7e9b66
commit 8fe3af33d8
2 changed files with 19 additions and 4 deletions

View File

@ -43,7 +43,7 @@
const StemmerEn = Nat.PorterStemmer;
// NDX
let Id = 1;
let Id;
const NDX_FIELDS = ndxDocFields();
const words = Tokenizer.tokenize.bind(Tokenizer);
const termFilter = StemmerEn.stem.bind(StemmerEn);
@ -639,6 +639,8 @@ export default Archivist;
}
});
Id = State.Index.size / 2 + 3;
State.SavedCacheFilePath = cacheFile;
State.SavedIndexFilePath = indexFile;
State.SavedFTSIndexDirPath = ftsDir;

View File

@ -163,6 +163,13 @@ function IndexView(urls) {
<h1>22120</h1>
<h2>Internet Offline Library</h2>
<h2>Archive Index</h2>
<form method=GET action=/search>
<fieldset>
<legend>Search your archive</legend>
<input type=search name=query placeholder="search your library">
<button>Search</button>
</fieldset>
</form>
<ul>
${
urls.map(([url,{title}]) => `
@ -179,7 +186,7 @@ function SearchResultView({results, query}) {
return `
<!DOCTYPE html>
<meta charset=utf-8>
<title>Your HTML Library</title>
<title>${query} - 22120 search results</title>
<style>
:root {
font-family: sans-serif;
@ -215,8 +222,14 @@ function SearchResultView({results, query}) {
}
</style>
<h1>22120</h1>
<h2>Internet Offline Library</h2>
<h2>Archive Results</h2>
<h2>Search results</h2>
<form method=GET action=/search>
<fieldset>
<legend>Search again</legend>
<input type=search name=query placeholder="search your library">
<button>Search</button>
</fieldset>
</form>
<p>
Showing results for <b>${query}</b>
</p>