Search, filter, and browse any JSON data. Includes full text, categorical data, and search interface with elasticsearch backend. Work in progress.
- Make sure you have elasticsearch and rails 4 installed
- On Mac OS do the following
- Go install Elasticsearch using homebrew
brew install elasticsearch
- Install RubyOnRails by typing
gem install rails
- Go install Elasticsearch using homebrew
- On Debian / Ubuntu
- Install dependencies
sudo apt-get install ruby-full
- Install ElasticSearch using package manager or 1.5.2 docs
- Install dependencies
- On Fedora
-
- Install Elasticsearch via the Fedora Yum instructions
-
- Install dependencies
sudo yum install make automake gcc gcc-c++ kernel-devel ruby-devel rubygem-railties
- Install dependencies
- On Mac OS do the following
- Clone repo
git clone --recursive git@github.com:TransparencyToolkit/LookingGlass.git
- Then cd into directory
cd LookingGlass
- Install Ruby dependencies
bundle install
- Generate simple form data
rails generate simple_form:install
- Browse to the dataspec directory
cd app/dataspec/
- Copy the example config file
instances/example-config.json
toinstances/your-config.json
- Add any additional dataspec files to
your-config.json
file by adding toDataset Config
array - Edit
importer.json
attributeInstance Config
to your configapp/dataspec/instances/your-config.json
You might want do add custom data related things to your instance as well. LookingGlass use datapackages for this goal such as month-names
for internationalization!
- Add any additional data packages to the
data_packages
directorycd data_packages
- git clone https://github.com/you/datapackage.git
This search should work for any JSON based dataset. If you want to add a dataset, see the app/dataspec folder for the necessary files. You will need to create your own dataspec-template
package.
- Prepare and save your data somewhere on your machine
- Either create a dataspec for it based on
datapec-template
or use existing - Modify your
config.json
file to include additional datasets
- Then start up ElasticSearch
- On Mac Os type
elasticsearch
- On Debian / Ubuntu installed via packages type
/etc/init.d/elasticsearch start
o - On Debian installed 1.5.2 go to
elasticsearch-1.5.2/bin/
and type./elasticsearch
- On Fedora type
sudo systemctl start elasticsearch.service
- On Mac Os type
- Then type
rails runner 'IndexManager.import_data(force: true)'
when importing / updating datasets - Start up the app
rails server
- Then access http://0.0.0.0:3000 in your browser
For Running In Production
- Compile your assets
rake assets:precompile
We would love your help and contributions improving upon LookingGlass. You can also customize how LookingGlass looks with a custom theme. To do either, first get a working instance setup on your development machine, then check out the following:
- Themes - documentation for making custom look and feel
- Developer Documentation - references of codebase