Skip to content

Commit

Permalink
feat(solr): solr installation instruction
Browse files Browse the repository at this point in the history
  • Loading branch information
yogesum committed Mar 19, 2017
1 parent ce4df04 commit 32a65ef
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- [Git](https://git-scm.com/)
- [Node.js and npm](nodejs.org) Node ^6.2.2, npm ^3.9.5
- [Gulp](http://gulpjs.com/) (`npm install --global gulp`)
- [Solr](http://lucene.apache.org/solr/) (`bash solr-install.sh`)

### Developing

Expand All @@ -17,3 +18,37 @@
## Build & development

Run `npm run build` or `gulp build` for building and `gulp serve` for preview.

## Solr Installation & Indexing

### Solr Binary Installation

- JAVA Runtime require for solr
- run below commands to install solr (or execute `bash solr-install.sh`)

```sh
SOLR_VER="6.4.2"
SOLR_URL="http://redrockdigimark.com/apachemirror/lucene/solr/${SOLR_VER}/solr-${SOLR_VER}.tgz"

# Get SOLR binary
wget ${SOLR_URL}

# extract installer script
tar xzf solr-${SOLR_VER}.tgz solr-${SOLR_VER}/bin/install_solr_service.sh --strip-components=2

# install solr with data directory in ~/solr
sudo bash install_solr_service.sh solr-${SOLR_VER}.tgz -u `whoami` -d ~/solr
```

### Solr Indexing

```sh
# make sure to create symbolic link
# to this project's solr conf from solr install directory
ln -s ~/sf-food-trucks/solr-conf ~/solr/data/food-trucks
```

- run `npm install` inside node project
- run `npm run solr-index` to index data from [DataSF](http://www.datasf.org/): [Food
Trucks](https://data.sfgov.org/Permitting/Mobile-Food-Facility-Permit/rqzj-sfat)
- run `npm serve` to launch website in your default browser
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@
"test": "gulp test",
"update-webdriver": "node node_modules/protractor/bin/webdriver-manager update",
"start": "node server",
"serve": "gulp serve",
"solr-install": "bash solr-install.sh",
"solr-index": "node solr-index",
"build": "gulp build",
"lint": "gulp lint:scripts --fail",
"validate": "npm ls"
Expand Down
11 changes: 11 additions & 0 deletions solr-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
SOLR_VER="6.4.2"
SOLR_URL="http://redrockdigimark.com/apachemirror/lucene/solr/${SOLR_VER}/solr-${SOLR_VER}.tgz"

# Get SOLR binary
wget ${SOLR_URL}

# extract installer script
tar xzf solr-${SOLR_VER}.tgz solr-${SOLR_VER}/bin/install_solr_service.sh --strip-components=2

# install solr with data directory in ~/solr
sudo bash install_solr_service.sh solr-${SOLR_VER}.tgz -u `whoami` -d ~/solr

0 comments on commit 32a65ef

Please sign in to comment.