Static Sites with Sphinx and Markdown Transcripts
Chapter: More Authoring
Lecture: Serverless search
Login or
purchase this course
to watch this video and the rest of the course contents.
0:00
Sphinx has long provided a bundled solution for server list search which kind of makes sense
0:08
Sphinx is a static site generator and there's not a search engine around and with this people type in search terms.
0:18
So for example in our site I could go and type 'thought' hit enter and even though it's just serving from files on desk,
0:29
I'm able to get search results and highlighting and stuff like that. Well how does this work. At build time
0:36
Sphinx writes an inverted index to a search index.js file. If I went to my build directory and went to HTML in this HTML directory,
0:50
I see that there's this file called searchindex.js and if I double click on it it's a big pile of java script that is a data structure for this
1:00
inverted index. And when someone asked to find search results,
1:05
this data file is downloaded to the browser processed in the browser by a Sphinx javascript library and the results are presented.
1:15
Now there are limits to this approach. Very large sites will generate a very large index and take a long time to download
1:23
it and to process it and for these case many Sphinx sites use server side or cloud based integration with read the docks.
1:33
For example you'll get access to elastic search based indexing. Not only is it a lot better performance and the browser download,
1:43
but needless to say the search results are far better than you would get with this simple server list search.