Search data for Constitution Annotated
-
Clone this repository
-
Initialize the UI submodule in elasticsearch-gui:
git submodule update --init
-
Install Elasticsearch 1.x. Later versions will not work with the data dump format or the UI. These can be updated with moderate effort (a day or two), by changing the index mapping syntax and re-indexing the pdfs.
-
Add CORS support by adding the following lines to config/elasticsearch.yml:
http.cors.enabled: true
http.cors.allow-origin: "*"
- Start Elasticsearch:
$./bin/elasticsearch
- Install elasticdump
- Load the constitutionmapping.json mapping to your local ES instance:
elasticdump --input=./constitutionsearchmap.json --type=mapping --output=http://localhost:9200/constitution
- Load the search data to your local ES instance:
elasticdump --input=./constitutionsearch.json --type=data --output=http://localhost:9200/constitution
-
Serve elasticsearch-gui from a static local server (e.g. for Python,
python -m SimpleHTTPServer 8000
) -
Navigate to /index.html
-
See ConstitionAnnotatedScreenshot.png for a preview of the search UI. In production, ES may be served through a proxy server to the /elasticproxy url on your server. On Linux, you can use the sample nginx.conf to serve ES as a proxy.