summaryrefslogtreecommitdiff
path: root/search/elasticlunr/README
blob: c1c318c3a194bdffb92345236798d70f775560d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Search index with elasticlunr

# Create a search index which can be served statically along the 
# static HTML pages to staticlunr.js.

# YAML/TOML/JSON and Markdown:
# remarshal (https://github.com/dbohdan/remarshal)
# pandoc (http://pandoc.org/)

# create XML and clean up some problematic constructs
./create_xml.sh > posts.xml
sed -i 's/xlink:href/href/g' posts.xml
sed -i 's/ xml:id="[^"]\+"//g' posts.xml
xmllint -noout posts.xml

# convert XML to JSON (at least the relevant fields for the index)

# use posts.json in a | node create_index.js pipeline
# -> results in posts_index.json

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