summaryrefslogtreecommitdiff
path: root/search/elasticlunr/README
diff options
context:
space:
mode:
Diffstat (limited to 'search/elasticlunr/README')
-rw-r--r--search/elasticlunr/README22
1 files changed, 22 insertions, 0 deletions
diff --git a/search/elasticlunr/README b/search/elasticlunr/README
new file mode 100644
index 0000000..8cbebea
--- /dev/null
+++ b/search/elasticlunr/README
@@ -0,0 +1,22 @@
+# Search index with elasticlunr
+
+# Create a search index which can be served statically along the
+# static HTML pages to staticlunr.js.
+
+# generate JSON dynamically with a JSON output generator,
+# see https://halfelf.org/2017/hugos-making-json/
+#curl http://localhost:1313/index.json > posts.json
+curl http://www.andreasbaumann.cc/index.json > posts.json
+
+# we need nodejs and npm
+npm install JSONStream event-stream
+
+# use posts.json in a | node create_index.js pipeline
+# -> results in posts_index.json
+./create_index
+cp posts.index ../../static/index/.
+
+# add as static contents to hugo site
+
+# load from JS search code on demand (first query) if possible,
+# if small, do it immediatelly when loading the search widget.