This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

It exists.

  • Loading branch information...
rgrove committed Sep 4, 2011
0 parents commit 704fb23d78276ca5c2592bb0f15b20a37fab8799
Showing with 1,668 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +18 −0 LICENSE.md
  3. +16 −0 Makefile
  4. +98 −0 README.md
  5. +8 −0 index.js
  6. +337 −0 lib/client.js
  7. +376 −0 lib/index.js
  8. +114 −0 lib/util.js
  9. +38 −0 package.json
  10. +310 −0 tests/offline-tests.js
  11. +323 −0 tests/online-tests.js
  12. +20 −0 tests/setup.sh
  13. +9 −0 tests/teardown.sh
@@ -0,0 +1 @@
+node_modules/
@@ -0,0 +1,18 @@
+Copyright (c) 2011 Ryan Grove <ryan@wonko.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the 'Software'), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,16 @@
+VOWS_BIN=node_modules/.bin/vows
+
+all: apidocs test
+
+test: offline-tests online-tests
+
+apidocs:
+ yuidoc -n -o docs ./ ./lib
+
+offline-tests:
+ $(VOWS_BIN) tests/offline-tests.js
+
+online-tests:
+ @tests/setup.sh > /dev/null
+ $(VOWS_BIN) tests/online-tests.js
+ @tests/teardown.sh > /dev/null
@@ -0,0 +1,98 @@
+Elastical
+=========
+
+Elastical is a Node.js client library for the
+[ElasticSearch](http://www.elasticsearch.org) REST API.
+
+It's not quite finished, but what's done so far has doc comments and unit tests.
+Keep an eye on this repo for updates.
+
+
+Installing
+----------
+
+ npm install https://github.com/rgrove/elastical/tarball/master
+
+
+Basic Usage
+-----------
+
+```js
+var elastical = require('elastical'),
+ client = new elastical.Client();
+
+// Index a document.
+client.index('blog', 'post', {
+ title: "Welcome to my stupid blog",
+ body : "This is the only thing I'll ever post.",
+ tags : ["welcome", "first post", "last post"]
+}, function (err, res) {
+ if (err) { throw err; }
+
+ // Retrieve the document we just indexed.
+ client.get('blog', res._id, function (err, doc) {
+ console.log(doc);
+ // => {
+ // title: "Welcome to my stupid blog",
+ // body : "This is the only thing I'll ever post.",
+ // tags : ["welcome", "first post", "last post"]
+ // }
+ });
+});
+```
+
+
+Developing
+----------
+
+Fork the git repo, clone it, then install the dev dependencies.
+
+ cd elastical
+ npm install
+
+Make your changes, add tests, then run the tests to make sure nothing broke.
+
+ make test
+
+This will run both offline and online tests. Online tests require an
+ElasticSearch server running at http://127.0.0.1:9200/. If you only want to run
+the offline tests (which don't require a server), run:
+
+ make offline-tests
+
+
+Pull Requests
+-------------
+
+Please make your changes in a topic branch and submit a pull request describing
+what the changes do and why I should merge them. Save time by including good
+tests for your changes (if you don't, I'll just ask you to add them).
+
+
+Support
+-------
+
+Nope.
+
+
+License
+-------
+
+Copyright (c) 2011 Ryan Grove (ryan@wonko.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the 'Software'), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,8 @@
+/**
+@module elastical
+**/
+
+module.exports = {
+ Client: require('./lib/client'),
+ Index : require('./lib/index')
+};
Oops, something went wrong.

0 comments on commit 704fb23

Please sign in to comment.