Intuitive faceted search tool configurable for any JSON dataset
CSS Ruby HTML JavaScript

README.md

LookingGlass

Search, filter, and browse any JSON data. Includes full text, categorical data, and search interface with elasticsearch backend.

LookingGlass can be used in combination with Harvester for crawling, parse and load documents.

Installing

  • Make sure you have elasticsearch and rails 4 installed
    • On Mac OS do the following
    • On Debian / Ubuntu
      • Install dependencies sudo apt-get install ruby-full
      • Install ElasticSearch using package manager or 1.5.2 docs
    • 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
  • 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 --bootstrap

Configuring

  • Browse to the dataspec directory cd app/dataspec/
  • Copy the example config file instances/example-config.json to instances/your-config.json
  • Add any additional dataspec files to your-config.json file by adding to Dataset Config array
  • Edit importer.json attribute Instance Config to your config app/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!

Adding Datasets

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 dataspec-template or use existing
  • Modify your config.json file to include additional datasets

Running LookingGlass

  • 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
  • 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

Developing

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: