push npm package metadata into elasticsearch for querying
npm install -g @npm/npm2es2
USAGE: npm2es2 --couch="http://host:port/db" --es="http://host:port/index"
npm2es also takes a --since=<seq number> command line argument incase you want to skip a full re-index
npm2es --couch="http://localhost:5984/registry" --es="http://localhost:9200/npm"
This will attach to the provided couchdb's _changes feed and automatically put every
package into elasticsearch for indexing. This script will run for as long as you let it, automatically applying updates to the search index.
First off, you'll want the following installed
couchdb(i.e.which couchdbshould work)java(i.e.which javashould should)mocha(npm install -g mocha)
Now we can run the test, just run npm test
The following environment variables may be used to configure this service:
COUCH_URLthe URL of the CouchDB to followELASTIC_SEARCHthe host (<host>[:port]) of the ElasticSearch to populateQUEUE_DEPTHmax number of docs in the backlog queue (default is 2048)MONITOR_PORTport to which the monitor service should bind (default is 5000)METRICSURL of the metrics sink (normally a nsqd URL)METRICS_REPORT_FREQUENCYthe frequency (in milliseconds) at which to report metrics (default is 10000)LEADER_SEQUENCE_POLL_FREQUENCYthe frequency (in milliseconds) at which to poll the leader (source CouchDB) for its maximum sequence number (default is 10000)
MIT © 2013 solids l.l.c.