summaryrefslogtreecommitdiff
path: root/search/elasticlunr/README
blob: 2295f36dfe6e898a46f70558f8829ac44772b356 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# 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
# use posts.json in a | node create_index.js pipeline
# -> results in posts_index.json
npm install JSONStream event-stream

# 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.