41 lines
2.3 KiB
Markdown
41 lines
2.3 KiB
Markdown
# PR2_Searchengine_localhost_examplesite
|
|
|
|
Hier wird beschrieben, wie man eine lokale (kleine) Version von Wikipeadia hosted um die Indexierung der Suchmaschine zu beschleunigen.
|
|
## Installiere Docker
|
|
1. Installiere [Docker Desktop](https://docs.docker.com/desktop/) bzw. [Docker](https://docs.docker.com/engine/) auf deiner Machine
|
|
2. Teste, ob die Installation erfolgreich war mit `docker run hello-world`
|
|
|
|
## Download wikipedia
|
|
1. Gehe zu [browse.library.kiwix.org/](https://browse.library.kiwix.org/#lang=deu&category=wikipedia)
|
|
2. Es gibt oft drei verschiedene Versionen zum Download
|
|
>>>
|
|
mini: only the introduction of each article, plus the infobox. Saves about 95% of space vs. the full version.
|
|
nopic: full articles, but no images. About 75% smaller than the full version.
|
|
maxi: the default full version.
|
|
[source: kiwix.org](https://get.kiwix.org/en/faq-items/what-do-mini-nopic-and-maxi-mean-in-the-wikipedia-zim-files/)
|
|
>>>
|
|
3. Ich nehme "Eine Auswahl der besten 50.000 Wikipedia-Artikel in deutscher Sprache" maxi version (~5GB) [Direct Download link](https://lbo.download.kiwix.org/zim/wikipedia/wikipedia_de_top_maxi_2026-04.zim); [BitTorrent](https://lbo.download.kiwix.org/zim/wikipedia/wikipedia_de_top_maxi_2026-04.zim.torrent)
|
|
|
|
## Starte localen server
|
|
Ersetze im anschließenden Befehl \<path> mit dem richtigen Wert.
|
|
|
|
\<path> = der absolute Pfad des Ordner indem die gedownloadete .zim Datei liegt bsp. /home/user/Downloads/
|
|
|
|
```
|
|
docker run -v <path>:/data -p 8345:8080 ghcr.io/kiwix/kiwix-serve '*.zim'
|
|
```
|
|
Der locale Server ist unter [localhost:8345](http://localhost:8345) erreichbar.
|
|
|
|
## Finde URL zum scrapen
|
|
Die normale URL eignet sich nicht zum scrapen, da man immer das selbe HTML bekommt.
|
|
Die Normale URL: [http://localhost:8345/viewer#wikipedia_de_top_mini_2026-04/index](http://localhost:8345/viewer#wikipedia_de_top_mini_2026-04/index)
|
|
|
|
Ersetze in der URL `viewer#` mit `content/`
|
|
|
|
Bearbeitete URL: [http://localhost:8345/content/wikipedia_de_top_mini_2026-04/index](http://localhost:8345/content/wikipedia_de_top_mini_2026-04/index)
|
|
|
|
Die bearbeitet URL eignet sich zum scrapen.
|
|
|
|
Vergesse nicht den scraper auf localhost zu beschränken, da auf jeder Seite am Ende ein link zum original Artikel auf [wikipedia.org](https://www.wikipedia.org/) ist (wenn man den link downloaded und analysiert hätten man sich den lokalen server auch sparen können).
|
|
|