Skip to content
This repository has been archived by the owner on Nov 7, 2018. It is now read-only.

Commit

Permalink
Merge pull request #304 from 18F/dev-docs
Browse files Browse the repository at this point in the history
docs for indexing
  • Loading branch information
ultrasaurus committed Mar 9, 2016
2 parents 83008f0 + 79a138c commit 3efccd3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
30 changes: 18 additions & 12 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ script, you can restart it with this command:

```brew services restart elasticsearch```


### Import the data

To get started, you can import sample data with:

`rake import`

### Start the app

```
Expand Down Expand Up @@ -83,18 +90,6 @@ http://127.0.0.1:3000/v1/cities?name=Cleveland. You should see something like:

### Custom Datasets

If you set the `DATA_PATH` environment variable to reference a new dataset,
it will be imported when the app starts up.

The data directory can optionally include a file called `data.yaml` (see [the sample one](sample-data/data.yaml) for its schema) that references one or more `.csv` files and specifies data types,
field name mapping, and other.

The app will check the version
in that file and if it is new, the old index (of the same name) will be
removed and re-created.

### Importing Data Manually

While the app is running (or anytime) you can run `rake import`. For instance, if you had a `presidents/data.yaml` file, you would import
it with:

Expand All @@ -118,6 +113,17 @@ they are using your local Elasticsearch)
rake es:delete[_all]
```

The data directory can optionally include a file called `data.yaml` (see [the sample one](sample-data/data.yaml) for its schema) that references one or more `.csv` files and specifies data types,
field name mapping, and other support data.

## Experimental web UI for indexing

Optionally, you can enable indexing from webapp, but this option is still experimental:
* `export INDEX_APP=enable`
* in your browser, go to /index/reindex

the old index (if present) will be deleted and re-created from source files at DATA_PATH.

## Want to help?

See [Contribution Guide](CONTRIBUTING.md)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ See our [Installation Guide](INSTALL.md)

## How this works

By default, data will be loaded from /sample-data
By default, data will be loaded from /sample-data when you run `rake import`

* [cities100.csv](sample-data/cities100.csv) - dataset of 100 most populous cities in the US
* [data.yaml](sample-data/data.yaml) - configuration for
Expand Down

0 comments on commit 3efccd3

Please sign in to comment.