This project contains configuration for setting up a docker instance of the Text and Math (TEMA) search system. The basic setup is for setting up search for an MMT archive but it should be straightforward to apply to other compatible by changing the configuration files.
To directly install and run this version see Installation.
To learn how to configure TEMA search for your own archive, check the detailed documentation in Setup Details below.
Additionally, check the file Dockerfile as well as the start-tema start-up script for the actual shell commands associated with the documentation.
After installing docker (see (https://docs.docker.com/installation/)) you can get the fully setup up version from docker hub by running
docker pull kwarc/tema_search
Then you can start the web server (will start on localhost:9999) with:
docker run -d -p 9999:8888 kwarc/tema_search start-tema
For internal configuration/access (i.e. bash) you can run:
docker run -t -i kwarc/tema_search /bin/bash
Don't forget to run docker commit afterwards to save the state.
For more information of how to configure it see the documentation below.
Starting from a bare-bones Linux installation (this instance is using Debian 8.1 -- jessie)
-
Installing dependencies
-
Installing plain MWS & Miscellaneous deps, mainly
g++,cmakeand a bunch of libs. Basically follows documentation from the MWS readme. -
Installing dependencies for the TEMA frontend, basically elasticsearch (for searching/indexing the text), php for serving and curl for setting up a couple of proxies (i.e. to the query processor (e.g. latexml) and mwsd) to avoid issues with e.g. blocked ports.
-
Installing
npmfor yet another proxy (to elasticsearch I think) that usesnodejsinstead ofphp. -
Cloning and installing MWS and friends: mws, mws-frontend, and tema-proxy
-
Clone the relevant MMT archive (for which you want to set up the search engine). The current scripts assumes the MathML-enriched HTML is in
export/planetary/narration/and the TEMA config inlib/tema-config.json. Additionally you can (need to) provide a query processor to convert math text queries from the input syntax to MathML and then provide a Javascript module in MWS frontend that posts to your converter and enable it. The default one is based on LateXML and handles TeX-style input. The parametrization of query processors should probably be improved in the MWS frontend project. This is the part you need to change to make a different instance. -
Setting up generated content
-
generate MWS harvests (via
mws/bin/docs2harvest) -
generate MWS index (via
mws/bin/mws-index) -
generate elasticsearch annotated documents (via
mws/bin/harvests2json) -
Starting everything up (see separate startup script
start-tema) -
Start the elasticsearch service
-
Load the generated index (annotated documents) into elasticsearch (using the scripts
run-setupand thenrun-bulkfrommws/scripts/elasticsearch/) -
Start the MWS daemon to serve the index
-
Start tema-proxy with
nodejs -
Serve mws-frontend (php will take care of the other two proxies)