{"_id":"resourceful-couchelastic","_rev":"43-b507e2ecb430375a0bddc4acd7ee5bd0","name":"resourceful-couchelastic","description":"Hybrid Couchdb/Elasticsearch engine for Resourceful","dist-tags":{"latest":"0.1.8"},"versions":{"0.0.2":{"author":{"name":"Richard Marr","email":"richard.marr@gmail.com"},"name":"resourceful-couchelastic","description":"Hybrid Couchdb/Elasticsearch engine for Resourceful","version":"0.0.2","repository":{"type":"git","url":"git://github.com/richmarr/resourceful-couchelastic.git"},"main":"index.js","scripts":{"test":"vows --spec -i"},"engines":{"node":"~0.4.7"},"dependencies":{"cradle":"0.5.x","elastical":"0.0.3","resourceful-elasticsearch":"0.0.3","resourceful":"0.1.5"},"devDependencies":{"vows":"~0.6.0"},"_npmUser":{"name":"richmarr","email":"richard.marr@gmail.com"},"_id":"resourceful-couchelastic@0.0.2","_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.4.7","_defaultsLoaded":true,"dist":{"shasum":"7bf6988fdd4be1bca9b20c161baa2687a48eef53","tarball":"https://registry.npmjs.org/resourceful-couchelastic/-/resourceful-couchelastic-0.0.2.tgz","integrity":"sha512-YXRy0UsisIxhpGfLK51kIZTMUJn8ptAF4MVQafx9jGOgDzwjMukNnkXveMGIPXBgFpcP9HFtOqo7216wdnm4Ng==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGIkFEu4GFKNMGXLZIlpKrvNevPPXX7nE4p2lWP5O6ZgAiEAxjYrDGjngvDpkINjFWRpgDG8nyxhzUlg9Ui1dsNDHIU="}]},"maintainers":[{"name":"richmarr","email":"richard.marr@gmail.com"}]},"0.0.3":{"author":{"name":"Richard Marr","email":"richard.marr@gmail.com"},"name":"resourceful-couchelastic","description":"Hybrid Couchdb/Elasticsearch engine for Resourceful","version":"0.0.3","repository":{"type":"git","url":"git://github.com/richmarr/resourceful-couchelastic.git"},"main":"index.js","scripts":{"test":"vows --spec -i"},"engines":{"node":"~0.4.7"},"dependencies":{"cradle":"0.5.x","elastical":"0.0.3","resourceful-elasticsearch":"0.0.3","resourceful":"0.1.5"},"devDependencies":{"vows":"~0.6.0"},"_npmUser":{"name":"richmarr","email":"richard.marr@gmail.com"},"_id":"resourceful-couchelastic@0.0.3","_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.4.7","_defaultsLoaded":true,"dist":{"shasum":"658d0a656dd981e62c1796c360996c63547d5188","tarball":"https://registry.npmjs.org/resourceful-couchelastic/-/resourceful-couchelastic-0.0.3.tgz","integrity":"sha512-K1tXx1t7WbHXp2Ki+qG8y9Wfdafm/kxkpPoXuvag8umNTxE2PYBsroUFkycgvKwxm3oiCaygyxtA9D+0DERvqg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHsKpiwXlE5WT6DDP6Kf7TfrApniBNdCmkQCK4zZ9SrkAiANiaATuw4C3Gx5EGNPoW/5v347Cxz+YdxjD8icaH+D/g=="}]},"maintainers":[{"name":"richmarr","email":"richard.marr@gmail.com"}]},"0.0.4":{"author":{"name":"Richard Marr","email":"richard.marr@gmail.com"},"name":"resourceful-couchelastic","description":"Hybrid Couchdb/Elasticsearch engine for Resourceful","version":"0.0.4","repository":{"type":"git","url":"git://github.com/richmarr/resourceful-couchelastic.git"},"main":"index.js","scripts":{"test":"vows --spec -i"},"engines":{"node":"~0.4.7"},"dependencies":{"cradle":"0.5.x","elastical":"0.0.7","resourceful-elasticsearch":"0.0.5","resourceful":"0.1.6"},"devDependencies":{"vows":"~0.6.0"},"_npmUser":{"name":"richmarr","email":"richard.marr@gmail.com"},"_id":"resourceful-couchelastic@0.0.4","_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.4.7","_defaultsLoaded":true,"dist":{"shasum":"25c899c01ca9de161a382974e5341db9fb065049","tarball":"https://registry.npmjs.org/resourceful-couchelastic/-/resourceful-couchelastic-0.0.4.tgz","integrity":"sha512-WWeexI9qFakGVcBZYdaHH39d/UkkAqHlI6F2A/WxlBDPlh4ze2eV5JMC90V1wcz2vS6mGgCO2ygRy1zY5HKcYg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEhw00iZQU9nvqa+CFcn4zh+g2eTOOkeCFW56cBd7pCnAiAGLIeWaeG1uwdQDzquZI260cyPmQH0bzFzaFrCo9NqUQ=="}]},"maintainers":[{"name":"richmarr","email":"richard.marr@gmail.com"}]},"0.0.5":{"author":{"name":"Richard Marr","email":"richard.marr@gmail.com"},"name":"resourceful-couchelastic","description":"Hybrid Couchdb/Elasticsearch engine for Resourceful","version":"0.0.5","repository":{"type":"git","url":"git://github.com/richmarr/resourceful-couchelastic.git"},"main":"index.js","scripts":{"test":"vows test/offline-* --spec -i"},"engines":{"node":"~0.4.7"},"dependencies":{"cradle":"0.5.x","elastical":"0.0.7","resourceful-elasticsearch":"0.0.6","resourceful":"0.1.6"},"devDependencies":{"vows":"~0.6.0"},"_npmUser":{"name":"richmarr","email":"richard.marr@gmail.com"},"_id":"resourceful-couchelastic@0.0.5","_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.4.7","_defaultsLoaded":true,"dist":{"shasum":"9b41e467e4e96a64be06529d40e1e7f97ee1e365","tarball":"https://registry.npmjs.org/resourceful-couchelastic/-/resourceful-couchelastic-0.0.5.tgz","integrity":"sha512-+GiMHgoJrIk2gnyZt/67g7ucqN6xP1fFs4C7XquGVR1pmLLLFeBnCjQaWAq4Xay6IijLTeN5WsgfzNzBfHn0FA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC7fm8AYDjsqURrzH7zCl849HhAeu4rR8SKgnjMYRSpmgIhAP9hgoc3tHQuAg1fk9b+v1l/UrKUGKSrTXp+OuYwYTrf"}]},"maintainers":[{"name":"richmarr","email":"richard.marr@gmail.com"}]},"0.0.6":{"author":{"name":"Richard Marr","email":"richard.marr@gmail.com"},"name":"resourceful-couchelastic","description":"Hybrid Couchdb/Elasticsearch engine for Resourceful","version":"0.0.6","repository":{"type":"git","url":"git://github.com/richmarr/resourceful-couchelastic.git"},"main":"index.js","scripts":{"test":"vows test/offline-* --spec -i"},"engines":{"node":"~0.4.7"},"dependencies":{"cradle":"0.5.x","elastical":"0.0.7","resourceful-elasticsearch":"0.0.9","resourceful":"0.1.6"},"devDependencies":{"vows":"~0.6.0"},"_npmUser":{"name":"richmarr","email":"richard.marr@gmail.com"},"_id":"resourceful-couchelastic@0.0.6","_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.4.7","_defaultsLoaded":true,"dist":{"shasum":"ad9e6d791a0f8290f9efacff26c8818b95903327","tarball":"https://registry.npmjs.org/resourceful-couchelastic/-/resourceful-couchelastic-0.0.6.tgz","integrity":"sha512-GXa9IeKS/OeAYHxn92EdX0QAi31gByoydPE2+Qlw+DHVyD8oYSR4u3FDyYzvNFSbpGJl8FmkBVzQhm0TD6R+nA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD/WWA1HaBqn+T36gitZR7npfwIGS9ExOHa/KTsZvxS6wIhAKmWwwATbLusUV8Bh36ViF8qyMPvB1UZQsFm06Yvzgv+"}]},"maintainers":[{"name":"richmarr","email":"richard.marr@gmail.com"}]},"0.0.7":{"author":{"name":"Richard Marr","email":"richard.marr@gmail.com"},"name":"resourceful-couchelastic","description":"Hybrid Couchdb/Elasticsearch engine for Resourceful","version":"0.0.7","repository":{"type":"git","url":"git://github.com/richmarr/resourceful-couchelastic.git"},"main":"index.js","scripts":{"test":"vows test/offline-* --spec -i"},"engines":{"node":"~0.4.7"},"dependencies":{"resourceful-elasticsearch":"0.0.10","resourceful":"0.1.6"},"devDependencies":{"cradle":"0.5.x","vows":"~0.6.0","elastical":"0.0.7"},"_npmUser":{"name":"richmarr","email":"richard.marr@gmail.com"},"_id":"resourceful-couchelastic@0.0.7","_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.4.7","_defaultsLoaded":true,"dist":{"shasum":"fe363fad9c6ad01c28f226e71ade1b9d5f5c3b84","tarball":"https://registry.npmjs.org/resourceful-couchelastic/-/resourceful-couchelastic-0.0.7.tgz","integrity":"sha512-MnhEYZ0XmlL4c8KKo99RVpnLkkVhgQobNWJT9NqvnUdQ2DniejqWOKb0fW9sGCNXVRW9ZwhFb7w0ieXZoxzBjQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDUGR4nw/J3TI2gg84hicgIGmyA2c1js07UubGEpk0eoAiEAoP2DmSXLcRVTwbQtGk8iS9gadkEKpX5tu3/hJiG+Qpc="}]},"maintainers":[{"name":"richmarr","email":"richard.marr@gmail.com"}]},"0.0.8":{"author":{"name":"Richard Marr","email":"richard.marr@gmail.com"},"name":"resourceful-couchelastic","description":"Hybrid Couchdb/Elasticsearch engine for Resourceful","version":"0.0.8","repository":{"type":"git","url":"git://github.com/richmarr/resourceful-couchelastic.git"},"main":"index.js","scripts":{"test":"vows test/offline-* --spec -i"},"engines":{"node":"~0.4.7"},"dependencies":{"resourceful-elasticsearch":"0.0.11","resourceful":"0.1.6"},"devDependencies":{"cradle":"0.5.x","vows":"~0.6.0","elastical":"0.0.7"},"_npmUser":{"name":"richmarr","email":"richard.marr@gmail.com"},"_id":"resourceful-couchelastic@0.0.8","_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.4.7","_defaultsLoaded":true,"dist":{"shasum":"1b3857b500f13dfae5ae4a502d5e2d4439cf0044","tarball":"https://registry.npmjs.org/resourceful-couchelastic/-/resourceful-couchelastic-0.0.8.tgz","integrity":"sha512-MTE44RG/pzzAVuSV5N9sO9jtt23A0S8WLMlefe9bh5JMoeQBQV6lWu4N87cLZNu9cCRaRlqt4pIZzOkZywim2w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDpTMUbBSNnMziO+f91TJKkcSCRdLY/t0hnxoviC2/R1wIhAJzOGroyVT6idrAzL87vlwPCK0JxDKi9O1e/zuhuoXej"}]},"maintainers":[{"name":"richmarr","email":"richard.marr@gmail.com"}]},"0.0.9":{"author":{"name":"Richard Marr","email":"richard.marr@gmail.com"},"name":"resourceful-couchelastic","description":"Hybrid Couchdb/Elasticsearch engine for Resourceful","version":"0.0.9","repository":{"type":"git","url":"git://github.com/richmarr/resourceful-couchelastic.git"},"main":"index.js","scripts":{"test":"vows test/offline-* --spec -i"},"engines":{"node":"~0.4.7"},"dependencies":{"resourceful-elasticsearch":"0.0.12","resourceful":"0.1.6"},"devDependencies":{"cradle":"0.5.x","vows":"~0.6.0","elastical":"0.0.7"},"_npmUser":{"name":"richmarr","email":"richard.marr@gmail.com"},"_id":"resourceful-couchelastic@0.0.9","_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.4.7","_defaultsLoaded":true,"dist":{"shasum":"f39dc970a858839cd8a940deceee8c2d2ad09348","tarball":"https://registry.npmjs.org/resourceful-couchelastic/-/resourceful-couchelastic-0.0.9.tgz","integrity":"sha512-3a9jHVEVW3nliXqf8sDRg6/HotcxM8K75sjn6XFyr6Do6tkfSPGh9K7XnFTj+5RqjPvzGcIxau+yoLRtTh0tgQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHizLlp1rPpJdz/H8nfAbYIaL/GwKtL0N1ehV4/0sO6SAiEA9hbJypEY8XjCgprQtXhEHGwOCbid+3c1UAnq9MH4JRY="}]},"maintainers":[{"name":"richmarr","email":"richard.marr@gmail.com"}]},"0.0.10":{"author":{"name":"Richard Marr","email":"richard.marr@gmail.com"},"name":"resourceful-couchelastic","description":"Hybrid Couchdb/Elasticsearch engine for Resourceful","version":"0.0.10","repository":{"type":"git","url":"git://github.com/richmarr/resourceful-couchelastic.git"},"main":"index.js","scripts":{"test":"vows test/offline-* --spec -i"},"engines":{"node":"~0.4.7"},"dependencies":{"resourceful-elasticsearch":"0.0.13","resourceful":"0.1.6"},"devDependencies":{"cradle":"0.5.x","vows":"~0.6.0","elastical":"0.0.7"},"_npmUser":{"name":"richmarr","email":"richard.marr@gmail.com"},"_id":"resourceful-couchelastic@0.0.10","_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.4.7","_defaultsLoaded":true,"dist":{"shasum":"e74236e7977d73033bf04c56b4ad7b4d82dd600f","tarball":"https://registry.npmjs.org/resourceful-couchelastic/-/resourceful-couchelastic-0.0.10.tgz","integrity":"sha512-NpyZ9lX/By3hAdm2iVzW/5WtRvbX/b36FeP+aHOaL6h1nfYx8hOb97azq4aRHSLHejQkiFjeYEfImR87/MT3XQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDxu/xvxW9Jo70zCIpoVQorrl0hA3tTUk4YX1qauNG3fgIgQfDRmH0Bh4j+vq+saAKStZL8kiwj+yOX5f/6+O1jDOs="}]},"maintainers":[{"name":"richmarr","email":"richard.marr@gmail.com"}]},"0.0.11":{"author":{"name":"Richard Marr","email":"richard.marr@gmail.com"},"name":"resourceful-couchelastic","description":"Hybrid Couchdb/Elasticsearch engine for Resourceful","version":"0.0.11","repository":{"type":"git","url":"git://github.com/richmarr/resourceful-couchelastic.git"},"main":"index.js","scripts":{"test":"vows test/offline-* --spec -i"},"engines":{"node":"~0.4.7"},"dependencies":{"resourceful-elasticsearch":"0.0.13","resourceful":"0.1.6"},"devDependencies":{"cradle":"0.5.x","vows":"~0.6.0","elastical":"0.0.7"},"_npmUser":{"name":"richmarr","email":"richard.marr@gmail.com"},"_id":"resourceful-couchelastic@0.0.11","_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.4.7","_defaultsLoaded":true,"dist":{"shasum":"569c8d9dbfb576c66fa1e3162530c9c7d7363523","tarball":"https://registry.npmjs.org/resourceful-couchelastic/-/resourceful-couchelastic-0.0.11.tgz","integrity":"sha512-W30L5YcWXmTB/99JS6m9N3RM7tp96aegi8btfLfFV81Oi7z5KktIYM8OdSbzambdZhC/1jvVCVsFd92OpSovog==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGWe+daj9/OY2QNAFzPbWmcYWt85b9TplbWYz3L4fPHeAiATTWfDVlEnwMdwQYWkUOsgL8j3MmhihmVhh7GFclK0cA=="}]},"maintainers":[{"name":"richmarr","email":"richard.marr@gmail.com"}]},"0.0.12":{"author":{"name":"Richard Marr","email":"richard.marr@gmail.com"},"name":"resourceful-couchelastic","description":"Hybrid Couchdb/Elasticsearch engine for Resourceful","version":"0.0.12","repository":{"type":"git","url":"git://github.com/richmarr/resourceful-couchelastic.git"},"main":"index.js","scripts":{"test":"vows test/offline-* --spec -i"},"engines":{"node":"~0.4.7"},"dependencies":{"resourceful-elasticsearch":"0.0.13","resourceful":"0.1.6"},"devDependencies":{"cradle":"0.5.x","vows":"~0.6.0","elastical":"0.0.7"},"_npmUser":{"name":"richmarr","email":"richard.marr@gmail.com"},"_id":"resourceful-couchelastic@0.0.12","_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.4.7","_defaultsLoaded":true,"dist":{"shasum":"bf40a24803dce5605fc25e425b94906cabe8287a","tarball":"https://registry.npmjs.org/resourceful-couchelastic/-/resourceful-couchelastic-0.0.12.tgz","integrity":"sha512-T3rshWbtD3G5ul7PIcmzBvDialMNBtBE35uZxJrTUDoDr95+8Ix+Hnpk34/QVuRhISh+vCNM3Yj7QwrxTSjmIw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDxl66SOT1c5/Edv2e9Cg6JfDkMGy7ddZq9y5EOnvlxPAIhAOVGfm0G9rShWHY9HaTifbUU6D0r1MJ5HD9yo8pDAaRR"}]},"maintainers":[{"name":"richmarr","email":"richard.marr@gmail.com"}]},"0.0.13":{"author":{"name":"Richard Marr","email":"richard.marr@gmail.com"},"name":"resourceful-couchelastic","description":"Hybrid Couchdb/Elasticsearch engine for Resourceful","version":"0.0.13","repository":{"type":"git","url":"git://github.com/richmarr/resourceful-couchelastic.git"},"main":"index.js","scripts":{"test":"vows test/offline-* --spec -i"},"engines":{"node":"~0.4.7"},"dependencies":{"resourceful-elasticsearch":"0.0.14","resourceful":"0.1.6"},"devDependencies":{"cradle":"0.5.x","vows":"~0.6.0","elastical":"0.0.7"},"_npmUser":{"name":"richmarr","email":"richard.marr@gmail.com"},"_id":"resourceful-couchelastic@0.0.13","_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.4.7","_defaultsLoaded":true,"dist":{"shasum":"781f9c0359ac98714d607c50b7249901279d3057","tarball":"https://registry.npmjs.org/resourceful-couchelastic/-/resourceful-couchelastic-0.0.13.tgz","integrity":"sha512-4MvLpl7uKuMombRgRUcZVWgmOWO/URqYEYEliXkz522a5QDa81F27SJ9KN1hGt09UMyJHfuf//JGzv537Qu4yA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDEC0aPRkep6//hTQSYSA5hgiudTpTVvcDzEY0rYIK/HgIgISTue9ImKS2/BUfN5MHpJnppXWMq233I9jFgZQRdQG4="}]},"maintainers":[{"name":"richmarr","email":"richard.marr@gmail.com"}]},"0.1.1":{"author":{"name":"Richard Marr","email":"richard.marr@gmail.com"},"name":"resourceful-couchelastic","description":"Hybrid Couchdb/Elasticsearch engine for Resourceful","version":"0.1.1","repository":{"type":"git","url":"git://github.com/richmarr/resourceful-couchelastic.git"},"main":"index.js","scripts":{"test":"vows test/offline-* --spec -i"},"engines":{"node":"~0.4.7"},"dependencies":{"resourceful-elasticsearch":"0.1.1","resourceful":"0.1.6"},"devDependencies":{"cradle":"0.5.x","vows":"~0.6.0"},"readme":"# resourceful-couchelastic [![Build Status](https://secure.travis-ci.org/richmarr/resourceful-couchelastic.png)](http://travis-ci.org/richmarr/resourceful-couchelastic)\n\nThe goal of CouchElastic is to provide seamless full-text and parametric search to Node.js apps, \naccomplished via [Flatiron][2]'s [Resourceful][3] ODM layer and the awesome power of CouchDB and [Elasticsearch][4]. \n\n\n## Configuration\n\nStart up an empty instance of CouchDB and an empty instance of Elasticsearch, then do this:\n\n``` js\n\tvar resourceful = require('resourceful'),\n\t\tCouchelastic = require('resourceful-couchelastic').Couchelastic;\n\t\n\tresourceful.engines.Couchelastic = Couchelastic;  // patch in the engine\n\tresourceful.use( 'couchelastic', {\n\t\t// CouchDB settings\n\t\thost : 'localhost', // optional - defaults to localhost\n\t\tport : 5984,        // optional - defaults to 5984\n\t\tdatabase:'db-name', // required\n\t\tsearch:{\n\t\t\t// Elasticsearch settings\n\t\t\tindex:'my-index-name'  // optional - defaults to db name\n\t\t}\n\t});\n```\n\nFrom this point onwards each `Resource` that you define will have its data stored in your specified \nCouchDB cluster and have an Elasticsearch indexing river configured to index the data for searching.\n\n## Define a resource\n\nAssuming you're already defining resources with Resourceful nothing more is required, but there are some additional options you might want to use. \nEverything specified within the options.search is passed straight into ES's Mapping API, allowing you fine-grained control over how that individual \nfield is treated in the index.\n\n``` js\n\tvar Creature = resourceful.define('Creature', function(){\n\t\tthis.string('name',{ required:true });\n\t\tthis.string('genus');\n\t\tthis.number('population');\n\t\tthis.number('legs',{\n\t\t\trequired: true,        // validation rules\n\t\t\tminimum: 0,\n\t\t\tsearch:{               \n\t\t\t\ttype:'integer'       // this tells ES what type of number this is\n\t\t\t}\n\t\t});\n\t\tthis.array('eats',{\n\t\t\tsearch:{ type:'string' }\n\t\t});\n\t\tthis.string('geography',{\n\t\t\tsearch:{\n\t\t\t\tanalyzer:'snowball'  // stem words to match word stem rather than exact form.\n\t\t\t}\n\t\t});\n\t});\n```\n\n## Synchronise your schema\n\nThe `sync()` method sets up your data sources for you. Until you sync you can `save()` and `get()` but not much more. \n\nFor each `Resource` type `sync` does the following:\n\n * Saves a CouchDB design document \n * Saves an Elasticsearch Mapping document\n * Creates a River on the Elasticsearch cluster that listens to CouchDB's replication stream\n\nYou'll need to `sync` after you make any significant design changes so that they're carried through to the schemas of both servers. Be aware that changing the data type of a field after data has already been indexed can be problematic.\n\n## Searching\n\nAssuming you've defined a Creature as per the Resourceful docs you should be able to search your database in free text like this.\n\n``` js\n\tCreature.search(\"fur\",function( err, creatures, response ){\n\t\t// creatures is a convenient array of Creature objects that match the search\n\t\t// response contains the entire ES response including search results and metadata\n\t});\n```\n\nYou can also search using the Elasticsearch query DSL, for example the following `fuzzy` query would also match the word \"oscar\"\n\n``` js\n\tActor.search({\n\t\tquery : {\n    \t\tfuzzy : { text : \"socar\" }\t\n\t\t}\n\t},function( err, actors, response ){\n\t\t// actors is an array\n\t\t// response is the full response containing metadata, e.g. facets\n\t});\n```\n\nOr using Resoureceful's parametric query method `Resourece.find()`\n\n``` js\n\tCreature.find({\n\t\tlegs:4,\n\t\teats:\"wasps\"\n\t},function( err, creatures, response ){\n\t\t// \n\t});\n```\n### Joining\n\nIf you have two data types related by a one-to-many foreign key you can do this (many-many not available yet): \n\n``` js\n\tCreature.search(\"name:wolf\",function( err, creatures ){\n\t\tGenus.join( creatures, function( err, creatures ){\n\t\t\t// creatures now contains:\n\t\t\t//     creature.genus_id - foreign key\n\t\t\t//     creature.genus - linked entity\n\t\t});\n\t});\n```\n\n### Security\n\nIf some of your Resource data is sensitive you might want to block it from being indexed\n\n``` js\n\tvar Employee = resourceful.define('Employee', function(){\n\t\tthis.string('name');\n\t\tthis.number('salary',{search:{index:'no'}});\n\t});\n```\n\n\n\nTODO - clean up the object search API and allow faceting etc.\n\n## Installation\n\n``` bash\n\tnpm install resourceful-couchelastic`\n```\n\n## Tests\n\nAll tests are written with [vows][0] and should be run with [npm][1]:\n\n``` bash\n  $ npm test\n```\n\n#### Author: Richard Marr\n#### License: Apache 2.0\n\n\n[0]: http://vowsjs.org\n[1]: http://npmjs.org\n[2]: http://flatironjs.org/\n[3]: https://github.com/flatiron/resourceful/\n[4]: http://www.elasticsearch.org","readmeFilename":"README.md","_id":"resourceful-couchelastic@0.1.1","dist":{"shasum":"90f8416592ee0eb92a650b8952e4cd81d207a00c","tarball":"https://registry.npmjs.org/resourceful-couchelastic/-/resourceful-couchelastic-0.1.1.tgz","integrity":"sha512-hF8PPE5N8g3dTe+cDOejiEH2MWpm24wxqcE/0Ujj4/BP4Rd0Z23TkbSWe9uR/o5IDWtrizzUGgA0mUj0+712ow==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD4cyg2fuwINeKHHq+Cv5PCDK3SSE120bQYtGOoVRiM9AIgfFFPdUcbG0B00gezn3fAeCEPCotBfej6QZqVHCW7YZ8="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"richmarr","email":"richard.marr@gmail.com"},"maintainers":[{"name":"richmarr","email":"richard.marr@gmail.com"}]},"0.1.2":{"author":{"name":"Richard Marr","email":"richard.marr@gmail.com"},"name":"resourceful-couchelastic","description":"Hybrid Couchdb/Elasticsearch engine for Resourceful","version":"0.1.2","repository":{"type":"git","url":"git://github.com/richmarr/resourceful-couchelastic.git"},"main":"index.js","scripts":{"test":"vows test/offline-* --spec -i"},"engines":{"node":"~0.4.7"},"dependencies":{"resourceful-elasticsearch":"0.1.1","resourceful":"0.1.6"},"devDependencies":{"cradle":"0.5.x","vows":"~0.6.0"},"_npmUser":{"name":"richmarr","email":"richard.marr@gmail.com"},"_id":"resourceful-couchelastic@0.1.2","_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.4.10","_defaultsLoaded":true,"dist":{"shasum":"6b704812c24f4644d213aae8c15ca56184bb5664","tarball":"https://registry.npmjs.org/resourceful-couchelastic/-/resourceful-couchelastic-0.1.2.tgz","integrity":"sha512-/5Tr3MtDcojIBLY/wHjUjgvJLO5H6XcMdZS1IOr0R8FpwM/6jr1ncZ9ulFuv/n01Wlh4tN/cPbqWie9h3LTRoQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDnmPWDjfqSZp4mJWJNDaiJ3HbO95gv+O654nTuLyVt+gIgeOi8n4UDgdPcIEkOtqShQovQYfXJV8l4nbHnh7Gw2uM="}]},"maintainers":[{"name":"richmarr","email":"richard.marr@gmail.com"}]},"0.1.3":{"author":{"name":"Richard Marr","email":"richard.marr@gmail.com"},"name":"resourceful-couchelastic","description":"Hybrid Couchdb/Elasticsearch engine for Resourceful","version":"0.1.3","repository":{"type":"git","url":"git://github.com/richmarr/resourceful-couchelastic.git"},"main":"index.js","scripts":{"test":"vows test/offline-* --spec -i"},"engines":{"node":"~0.4.7"},"dependencies":{"resourceful-elasticsearch":"0.1.3","resourceful":"0.1.6"},"devDependencies":{"cradle":"0.5.x","vows":"~0.6.0"},"_npmUser":{"name":"richmarr","email":"richard.marr@gmail.com"},"_id":"resourceful-couchelastic@0.1.3","_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.4.10","_defaultsLoaded":true,"dist":{"shasum":"26c22af1cd4e5acb26d66a00ded8d3fecd0ebb70","tarball":"https://registry.npmjs.org/resourceful-couchelastic/-/resourceful-couchelastic-0.1.3.tgz","integrity":"sha512-vCJK9ySV4pmJSiUGI+KCO9AFnoYqwfI7Iet5mcTMzA19p8ZLfomakepLQvomPFrMy3fWPoC8DKVl4C39qFq3Qg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDY0QUADoxp6B65WcDgLSCCihGSQ7khFNkyodRTIcFWNQIgdPBrApBuMJrqnAIB51wz6FeIX3hfcOdy9xN05xqf2rY="}]},"maintainers":[{"name":"richmarr","email":"richard.marr@gmail.com"}]},"0.1.4":{"author":{"name":"Richard Marr","email":"richard.marr@gmail.com"},"name":"resourceful-couchelastic","description":"Hybrid Couchdb/Elasticsearch engine for Resourceful","version":"0.1.4","repository":{"type":"git","url":"git://github.com/richmarr/resourceful-couchelastic.git"},"main":"index.js","scripts":{"test":"vows test/offline-* --spec -i"},"engines":{"node":"~0.4.7"},"dependencies":{"resourceful-elasticsearch":"0.1.3","resourceful":"0.1.6"},"devDependencies":{"cradle":"0.5.x","vows":"~0.6.0"},"readme":"# resourceful-couchelastic [![Build Status](https://secure.travis-ci.org/richmarr/resourceful-couchelastic.png)](http://travis-ci.org/richmarr/resourceful-couchelastic)\n\nThe goal of CouchElastic is to provide seamless full-text and parametric search to Node.js apps, \naccomplished via [Flatiron][2]'s [Resourceful][3] ODM layer and the awesome power of CouchDB and [Elasticsearch][4]. \n\n\n## Configuration\n\nStart up an empty instance of CouchDB and an empty instance of Elasticsearch, then do this:\n\n``` js\n\tvar resourceful = require('resourceful'),\n\t\tCouchelastic = require('resourceful-couchelastic').Couchelastic;\n\t\n\tresourceful.engines.Couchelastic = Couchelastic;  // patch in the engine\n\tresourceful.use( 'couchelastic', {\n\t\t// CouchDB settings\n\t\thost : 'localhost', // optional - defaults to localhost\n\t\tport : 5984,        // optional - defaults to 5984\n\t\tdatabase:'db-name', // required\n\t\tsearch:{\n\t\t\t// Elasticsearch settings\n\t\t\tindex:'my-index-name'  // optional - defaults to db name\n\t\t}\n\t});\n```\n\nFrom this point onwards each `Resource` that you define will have its data stored in your specified \nCouchDB cluster and have an Elasticsearch indexing river configured to index the data for searching.\n\n## Define a resource\n\nAssuming you're already defining resources with Resourceful nothing more is required, but there are some additional options you might want to use. \nEverything specified within the options.search is passed straight into ES's Mapping API, allowing you fine-grained control over how that individual \nfield is treated in the index.\n\n``` js\n\tvar Creature = resourceful.define('Creature', function(){\n\t\tthis.string('name',{ required:true });\n\t\tthis.string('genus');\n\t\tthis.number('population');\n\t\tthis.number('legs',{\n\t\t\trequired: true,        // validation rules\n\t\t\tminimum: 0,\n\t\t\tsearch:{               \n\t\t\t\ttype:'integer'       // this tells ES what type of number this is\n\t\t\t}\n\t\t});\n\t\tthis.array('eats',{\n\t\t\tsearch:{ type:'string' }\n\t\t});\n\t\tthis.string('geography',{\n\t\t\tsearch:{\n\t\t\t\tanalyzer:'snowball'  // stem words to match word stem rather than exact form.\n\t\t\t}\n\t\t});\n\t});\n```\n\n## Synchronise your schema\n\nThe `sync()` method sets up your data sources for you. Until you sync you can `save()` and `get()` but not much more. \n\nFor each `Resource` type `sync` does the following:\n\n * Saves a CouchDB design document \n * Saves an Elasticsearch Mapping document\n * Creates a River on the Elasticsearch cluster that listens to CouchDB's replication stream\n\nYou'll need to `sync` after you make any significant design changes so that they're carried through to the schemas of both servers. Be aware that changing the data type of a field after data has already been indexed can be problematic.\n\n## Searching\n\nAssuming you've defined a Creature as per the Resourceful docs you should be able to search your database in free text like this.\n\n``` js\n\tCreature.search(\"fur\",function( err, creatures, response ){\n\t\t// creatures is a convenient array of Creature objects that match the search\n\t\t// response contains the entire ES response including search results and metadata\n\t});\n```\n\nYou can also search using the Elasticsearch query DSL, for example the following `fuzzy` query would also match the word \"oscar\"\n\n``` js\n\tActor.search({\n\t\tquery : {\n    \t\tfuzzy : { text : \"socar\" }\t\n\t\t}\n\t},function( err, actors, response ){\n\t\t// actors is an array\n\t\t// response is the full response containing metadata, e.g. facets\n\t});\n```\n\nOr using Resoureceful's parametric query method `Resourece.find()`\n\n``` js\n\tCreature.find({\n\t\tlegs:4,\n\t\teats:\"wasps\"\n\t},function( err, creatures, response ){\n\t\t// \n\t});\n```\n### Joining\n\nIf you have two data types related by a one-to-many foreign key you can do this (many-many not available yet): \n\n``` js\n\tCreature.search(\"name:wolf\",function( err, creatures ){\n\t\tGenus.join( creatures, function( err, creatures ){\n\t\t\t// creatures now contains:\n\t\t\t//     creature.genus_id - foreign key\n\t\t\t//     creature.genus - linked entity\n\t\t});\n\t});\n```\n\n### Security\n\nIf some of your Resource data is sensitive you might want to block it from being indexed\n\n``` js\n\tvar Employee = resourceful.define('Employee', function(){\n\t\tthis.string('name');\n\t\tthis.number('salary',{search:{index:'no'}});\n\t});\n```\n\n\n\nTODO - clean up the object search API and allow faceting etc.\n\n## Installation\n\n``` bash\n\tnpm install resourceful-couchelastic`\n```\n\n## Tests\n\nAll tests are written with [vows][0] and should be run with [npm][1]:\n\n``` bash\n  $ npm test\n```\n\n#### Author: Richard Marr\n#### License: Apache 2.0\n\n\n[0]: http://vowsjs.org\n[1]: http://npmjs.org\n[2]: http://flatironjs.org/\n[3]: https://github.com/flatiron/resourceful/\n[4]: http://www.elasticsearch.org","readmeFilename":"README.md","_id":"resourceful-couchelastic@0.1.4","dist":{"shasum":"b2759abcdfc751c7de4180b7fc9bad50a5ab1716","tarball":"https://registry.npmjs.org/resourceful-couchelastic/-/resourceful-couchelastic-0.1.4.tgz","integrity":"sha512-yfAxx7zMmQZfk5nHHAebm7bFGa60ZygO1Xomm6mr1MJE/kEkS+v/qFGHYQgDk0TM31cU6SQZLQzCccKy4bnxKA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCt2u2O6/iPLo+v+Q3Z7GpNvxXZrhL74PAq8Q6RgzenWQIhAJgr7ShAgl3etx6XMe0DHkuBtJ25qF7P7MnhSs7PoNF9"}]},"_npmVersion":"1.1.65","_npmUser":{"name":"richmarr","email":"richard.marr@gmail.com"},"maintainers":[{"name":"richmarr","email":"richard.marr@gmail.com"}]},"0.1.5":{"author":{"name":"Richard Marr","email":"richard.marr@gmail.com"},"name":"resourceful-couchelastic","description":"Hybrid Couchdb/Elasticsearch engine for Resourceful","version":"0.1.5","repository":{"type":"git","url":"git://github.com/richmarr/resourceful-couchelastic.git"},"main":"index.js","scripts":{"test":"vows test/offline-* --spec -i"},"engines":{"node":"~0.4.7"},"dependencies":{"resourceful-elasticsearch":"0.1.4","resourceful":"0.1.6"},"devDependencies":{"cradle":"0.5.x","vows":"~0.6.0"},"readme":"# resourceful-couchelastic [![Build Status](https://secure.travis-ci.org/richmarr/resourceful-couchelastic.png)](http://travis-ci.org/richmarr/resourceful-couchelastic)\n\nThe goal of CouchElastic is to provide seamless full-text and parametric search to Node.js apps, \naccomplished via [Flatiron][2]'s [Resourceful][3] ODM layer and the awesome power of CouchDB and [Elasticsearch][4]. \n\n\n## Configuration\n\nStart up an empty instance of CouchDB and an empty instance of Elasticsearch, then do this:\n\n``` js\n\tvar resourceful = require('resourceful'),\n\t\tCouchelastic = require('resourceful-couchelastic').Couchelastic;\n\t\n\tresourceful.engines.Couchelastic = Couchelastic;  // patch in the engine\n\tresourceful.use( 'couchelastic', {\n\t\t// CouchDB settings\n\t\thost : 'localhost', // optional - defaults to localhost\n\t\tport : 5984,        // optional - defaults to 5984\n\t\tdatabase:'db-name', // required\n\t\tsearch:{\n\t\t\t// Elasticsearch settings\n\t\t\tindex:'my-index-name'  // optional - defaults to db name\n\t\t}\n\t});\n```\n\nFrom this point onwards each `Resource` that you define will have its data stored in your specified \nCouchDB cluster and have an Elasticsearch indexing river configured to index the data for searching.\n\n## Define a resource\n\nAssuming you're already defining resources with Resourceful nothing more is required, but there are some additional options you might want to use. \nEverything specified within the options.search is passed straight into ES's Mapping API, allowing you fine-grained control over how that individual \nfield is treated in the index.\n\n``` js\n\tvar Creature = resourceful.define('Creature', function(){\n\t\tthis.string('name',{ required:true });\n\t\tthis.string('genus');\n\t\tthis.number('population');\n\t\tthis.number('legs',{\n\t\t\trequired: true,        // validation rules\n\t\t\tminimum: 0,\n\t\t\tsearch:{               \n\t\t\t\ttype:'integer'       // this tells ES what type of number this is\n\t\t\t}\n\t\t});\n\t\tthis.array('eats',{\n\t\t\tsearch:{ type:'string' }\n\t\t});\n\t\tthis.string('geography',{\n\t\t\tsearch:{\n\t\t\t\tanalyzer:'snowball'  // stem words to match word stem rather than exact form.\n\t\t\t}\n\t\t});\n\t});\n```\n\n## Synchronise your schema\n\nThe `sync()` method sets up your data sources for you. Until you sync you can `save()` and `get()` but not much more. \n\nFor each `Resource` type `sync` does the following:\n\n * Saves a CouchDB design document \n * Saves an Elasticsearch Mapping document\n * Creates a River on the Elasticsearch cluster that listens to CouchDB's replication stream\n\nYou'll need to `sync` after you make any significant design changes so that they're carried through to the schemas of both servers. Be aware that changing the data type of a field after data has already been indexed can be problematic.\n\n## Searching\n\nAssuming you've defined a Creature as per the Resourceful docs you should be able to search your database in free text like this.\n\n``` js\n\tCreature.search(\"fur\",function( err, creatures, response ){\n\t\t// creatures is a convenient array of Creature objects that match the search\n\t\t// response contains the entire ES response including search results and metadata\n\t});\n```\n\nYou can also search using the Elasticsearch query DSL, for example the following `fuzzy` query would also match the word \"oscar\"\n\n``` js\n\tActor.search({\n\t\tquery : {\n    \t\tfuzzy : { text : \"socar\" }\t\n\t\t}\n\t},function( err, actors, response ){\n\t\t// actors is an array\n\t\t// response is the full response containing metadata, e.g. facets\n\t});\n```\n\nOr using Resoureceful's parametric query method `Resourece.find()`\n\n``` js\n\tCreature.find({\n\t\tlegs:4,\n\t\teats:\"wasps\"\n\t},function( err, creatures, response ){\n\t\t// \n\t});\n```\n### Joining\n\nIf you have two data types related by a one-to-many foreign key you can do this (many-many not available yet): \n\n``` js\n\tCreature.search(\"name:wolf\",function( err, creatures ){\n\t\tGenus.join( creatures, function( err, creatures ){\n\t\t\t// creatures now contains:\n\t\t\t//     creature.genus_id - foreign key\n\t\t\t//     creature.genus - linked entity\n\t\t});\n\t});\n```\n\n### Security\n\nIf some of your Resource data is sensitive you might want to block it from being indexed\n\n``` js\n\tvar Employee = resourceful.define('Employee', function(){\n\t\tthis.string('name');\n\t\tthis.number('salary',{search:{index:'no'}});\n\t});\n```\n\n\n\nTODO - clean up the object search API and allow faceting etc.\n\n## Installation\n\n``` bash\n\tnpm install resourceful-couchelastic`\n```\n\n## Tests\n\nAll tests are written with [vows][0] and should be run with [npm][1]:\n\n``` bash\n  $ npm test\n```\n\n#### Author: Richard Marr\n#### License: Apache 2.0\n\n\n[0]: http://vowsjs.org\n[1]: http://npmjs.org\n[2]: http://flatironjs.org/\n[3]: https://github.com/flatiron/resourceful/\n[4]: http://www.elasticsearch.org","readmeFilename":"README.md","_id":"resourceful-couchelastic@0.1.5","dist":{"shasum":"96cad2f3d01840af67b05db625c5c9ccf9307237","tarball":"https://registry.npmjs.org/resourceful-couchelastic/-/resourceful-couchelastic-0.1.5.tgz","integrity":"sha512-llzjCrl/J97LjpjfO0NJjrCWewSt7LFTPUEca8bZjgcV0sibN8JxJdBYVo7YTHq+ZH1jr6mwqQiq0QT97aB48A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC1I1vwiFiQ8S7F8SeUZx0mg2SbSMb1HrJmQent11/viAiEAnmGLFmvk0mXIyL9ODernb8zjIrflxMYo2D2AAtMTBmw="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"richmarr","email":"richard.marr@gmail.com"},"maintainers":[{"name":"richmarr","email":"richard.marr@gmail.com"}]},"0.1.6":{"author":{"name":"Richard Marr","email":"richard.marr@gmail.com"},"name":"resourceful-couchelastic","description":"Hybrid Couchdb/Elasticsearch engine for Resourceful","version":"0.1.6","repository":{"type":"git","url":"git://github.com/richmarr/resourceful-couchelastic.git"},"main":"index.js","scripts":{"test":"vows test/offline-* --spec -i"},"engines":{"node":"~0.4.7"},"dependencies":{"resourceful-elasticsearch":"0.1.5","resourceful":"0.1.6"},"devDependencies":{"cradle":"0.5.x","vows":"~0.6.0"},"readme":"# resourceful-couchelastic [![Build Status](https://secure.travis-ci.org/richmarr/resourceful-couchelastic.png)](http://travis-ci.org/richmarr/resourceful-couchelastic)\n\nThe goal of CouchElastic is to provide seamless full-text and parametric search to Node.js apps, \naccomplished via [Flatiron][2]'s [Resourceful][3] ODM layer and the awesome power of CouchDB and [Elasticsearch][4]. \n\n\n## Configuration\n\nStart up an empty instance of CouchDB and an empty instance of Elasticsearch, then do this:\n\n``` js\n\tvar resourceful = require('resourceful'),\n\t\tCouchelastic = require('resourceful-couchelastic').Couchelastic;\n\t\n\tresourceful.engines.Couchelastic = Couchelastic;  // patch in the engine\n\tresourceful.use( 'couchelastic', {\n\t\t// CouchDB settings\n\t\thost : 'localhost', // optional - defaults to localhost\n\t\tport : 5984,        // optional - defaults to 5984\n\t\tdatabase:'db-name', // required\n\t\tsearch:{\n\t\t\t// Elasticsearch settings\n\t\t\tindex:'my-index-name'  // optional - defaults to db name\n\t\t}\n\t});\n```\n\nFrom this point onwards each `Resource` that you define will have its data stored in your specified \nCouchDB cluster and have an Elasticsearch indexing river configured to index the data for searching.\n\n## Define a resource\n\nAssuming you're already defining resources with Resourceful nothing more is required, but there are some additional options you might want to use. \nEverything specified within the options.search is passed straight into ES's Mapping API, allowing you fine-grained control over how that individual \nfield is treated in the index.\n\n``` js\n\tvar Creature = resourceful.define('Creature', function(){\n\t\tthis.string('name',{ required:true });\n\t\tthis.string('genus');\n\t\tthis.number('population');\n\t\tthis.number('legs',{\n\t\t\trequired: true,        // validation rules\n\t\t\tminimum: 0,\n\t\t\tsearch:{               \n\t\t\t\ttype:'integer'       // this tells ES what type of number this is\n\t\t\t}\n\t\t});\n\t\tthis.array('eats',{\n\t\t\tsearch:{ type:'string' }\n\t\t});\n\t\tthis.string('geography',{\n\t\t\tsearch:{\n\t\t\t\tanalyzer:'snowball'  // stem words to match word stem rather than exact form.\n\t\t\t}\n\t\t});\n\t});\n```\n\n## Synchronise your schema\n\nThe `sync()` method sets up your data sources for you. Until you sync you can `save()` and `get()` but not much more. \n\nFor each `Resource` type `sync` does the following:\n\n * Saves a CouchDB design document \n * Saves an Elasticsearch Mapping document\n * Creates a River on the Elasticsearch cluster that listens to CouchDB's replication stream\n\nYou'll need to `sync` after you make any significant design changes so that they're carried through to the schemas of both servers. Be aware that changing the data type of a field after data has already been indexed can be problematic.\n\n## Searching\n\nAssuming you've defined a Creature as per the Resourceful docs you should be able to search your database in free text like this.\n\n``` js\n\tCreature.search(\"fur\",function( err, creatures, response ){\n\t\t// creatures is a convenient array of Creature objects that match the search\n\t\t// response contains the entire ES response including search results and metadata\n\t});\n```\n\nYou can also search using the Elasticsearch query DSL, for example the following `fuzzy` query would also match the word \"oscar\"\n\n``` js\n\tActor.search({\n\t\tquery : {\n    \t\tfuzzy : { text : \"socar\" }\t\n\t\t}\n\t},function( err, actors, response ){\n\t\t// actors is an array\n\t\t// response is the full response containing metadata, e.g. facets\n\t});\n```\n\nOr using Resoureceful's parametric query method `Resourece.find()`\n\n``` js\n\tCreature.find({\n\t\tlegs:4,\n\t\teats:\"wasps\"\n\t},function( err, creatures, response ){\n\t\t// \n\t});\n```\n### Joining\n\nIf you have two data types related by a one-to-many foreign key you can do this (many-many not available yet): \n\n``` js\n\tCreature.search(\"name:wolf\",function( err, creatures ){\n\t\tGenus.join( creatures, function( err, creatures ){\n\t\t\t// creatures now contains:\n\t\t\t//     creature.genus_id - foreign key\n\t\t\t//     creature.genus - linked entity\n\t\t});\n\t});\n```\n\n### Security\n\nIf some of your Resource data is sensitive you might want to block it from being indexed\n\n``` js\n\tvar Employee = resourceful.define('Employee', function(){\n\t\tthis.string('name');\n\t\tthis.number('salary',{search:{index:'no'}});\n\t});\n```\n\n\n\nTODO - clean up the object search API and allow faceting etc.\n\n## Installation\n\n``` bash\n\tnpm install resourceful-couchelastic`\n```\n\n## Tests\n\nAll tests are written with [vows][0] and should be run with [npm][1]:\n\n``` bash\n  $ npm test\n```\n\n#### Author: Richard Marr\n#### License: Apache 2.0\n\n\n[0]: http://vowsjs.org\n[1]: http://npmjs.org\n[2]: http://flatironjs.org/\n[3]: https://github.com/flatiron/resourceful/\n[4]: http://www.elasticsearch.org","readmeFilename":"README.md","_id":"resourceful-couchelastic@0.1.6","dist":{"shasum":"76177fe4ae3fa00b4519254c485421b2183fe6d3","tarball":"https://registry.npmjs.org/resourceful-couchelastic/-/resourceful-couchelastic-0.1.6.tgz","integrity":"sha512-dKaJjqpCWR8Do2tzpN6Gtb9GP/g3tZs6oQ87IULJdMYoaaGpi4/XnjqAkAqLOgqeTUgwvzG3/38OyZKWZ89ekA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDCY/1DjvFB/v1EzXRsvvuucqdwr3xLfigYUfqd3rVUBAiASEkCZSPIlNpZzfJyEmN3kBYB5Rg+S58kxcbYGjNVh5w=="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"richmarr","email":"richard.marr@gmail.com"},"maintainers":[{"name":"richmarr","email":"richard.marr@gmail.com"}]},"0.1.7":{"author":{"name":"Richard Marr","email":"richard.marr@gmail.com"},"name":"resourceful-couchelastic","description":"Hybrid Couchdb/Elasticsearch engine for Resourceful","version":"0.1.7","repository":{"type":"git","url":"git://github.com/richmarr/resourceful-couchelastic.git"},"main":"index.js","scripts":{"test":"vows test/offline-* --spec -i"},"engines":{"node":"~0.4.7"},"dependencies":{"resourceful-elasticsearch":"0.1.5","resourceful":"0.1.6"},"devDependencies":{"cradle":"0.5.x","vows":"~0.6.0"},"readme":"# resourceful-couchelastic [![Build Status](https://secure.travis-ci.org/richmarr/resourceful-couchelastic.png)](http://travis-ci.org/richmarr/resourceful-couchelastic)\n\nThe goal of CouchElastic is to provide seamless full-text and parametric search to Node.js apps, \naccomplished via [Flatiron][2]'s [Resourceful][3] ODM layer and the awesome power of CouchDB and [Elasticsearch][4]. \n\n\n## Configuration\n\nStart up an empty instance of CouchDB and an empty instance of Elasticsearch, then do this:\n\n``` js\n\tvar resourceful = require('resourceful'),\n\t\tCouchelastic = require('resourceful-couchelastic').Couchelastic;\n\t\n\tresourceful.engines.Couchelastic = Couchelastic;  // patch in the engine\n\tresourceful.use( 'couchelastic', {\n\t\t// CouchDB settings\n\t\thost : 'localhost', // optional - defaults to localhost\n\t\tport : 5984,        // optional - defaults to 5984\n\t\tdatabase:'db-name', // required\n\t\tsearch:{\n\t\t\t// Elasticsearch settings\n\t\t\tindex:'my-index-name'  // optional - defaults to db name\n\t\t}\n\t});\n```\n\nFrom this point onwards each `Resource` that you define will have its data stored in your specified \nCouchDB cluster and have an Elasticsearch indexing river configured to index the data for searching.\n\n## Define a resource\n\nAssuming you're already defining resources with Resourceful nothing more is required, but there are some additional options you might want to use. \nEverything specified within the options.search is passed straight into ES's Mapping API, allowing you fine-grained control over how that individual \nfield is treated in the index.\n\n``` js\n\tvar Creature = resourceful.define('Creature', function(){\n\t\tthis.string('name',{ required:true });\n\t\tthis.string('genus');\n\t\tthis.number('population');\n\t\tthis.number('legs',{\n\t\t\trequired: true,        // validation rules\n\t\t\tminimum: 0,\n\t\t\tsearch:{               \n\t\t\t\ttype:'integer'       // this tells ES what type of number this is\n\t\t\t}\n\t\t});\n\t\tthis.array('eats',{\n\t\t\tsearch:{ type:'string' }\n\t\t});\n\t\tthis.string('geography',{\n\t\t\tsearch:{\n\t\t\t\tanalyzer:'snowball'  // stem words to match word stem rather than exact form.\n\t\t\t}\n\t\t});\n\t});\n```\n\n## Synchronise your schema\n\nThe `sync()` method sets up your data sources for you. Until you sync you can `save()` and `get()` but not much more. \n\nFor each `Resource` type `sync` does the following:\n\n * Saves a CouchDB design document \n * Saves an Elasticsearch Mapping document\n * Creates a River on the Elasticsearch cluster that listens to CouchDB's replication stream\n\nYou'll need to `sync` after you make any significant design changes so that they're carried through to the schemas of both servers. Be aware that changing the data type of a field after data has already been indexed can be problematic.\n\n## Searching\n\nAssuming you've defined a Creature as per the Resourceful docs you should be able to search your database in free text like this.\n\n``` js\n\tCreature.search(\"fur\",function( err, creatures, response ){\n\t\t// creatures is a convenient array of Creature objects that match the search\n\t\t// response contains the entire ES response including search results and metadata\n\t});\n```\n\nYou can also search using the Elasticsearch query DSL, for example the following `fuzzy` query would also match the word \"oscar\"\n\n``` js\n\tActor.search({\n\t\tquery : {\n    \t\tfuzzy : { text : \"socar\" }\t\n\t\t}\n\t},function( err, actors, response ){\n\t\t// actors is an array\n\t\t// response is the full response containing metadata, e.g. facets\n\t});\n```\n\nOr using Resoureceful's parametric query method `Resourece.find()`\n\n``` js\n\tCreature.find({\n\t\tlegs:4,\n\t\teats:\"wasps\"\n\t},function( err, creatures, response ){\n\t\t// \n\t});\n```\n### Joining\n\nIf you have two data types related by a one-to-many foreign key you can do this (many-many not available yet): \n\n``` js\n\tCreature.search(\"name:wolf\",function( err, creatures ){\n\t\tGenus.join( creatures, function( err, creatures ){\n\t\t\t// creatures now contains:\n\t\t\t//     creature.genus_id - foreign key\n\t\t\t//     creature.genus - linked entity\n\t\t});\n\t});\n```\n\n### Security\n\nIf some of your Resource data is sensitive you might want to block it from being indexed\n\n``` js\n\tvar Employee = resourceful.define('Employee', function(){\n\t\tthis.string('name');\n\t\tthis.number('salary',{search:{index:'no'}});\n\t});\n```\n\n\n\nTODO - clean up the object search API and allow faceting etc.\n\n## Installation\n\n``` bash\n\tnpm install resourceful-couchelastic`\n```\n\n## Tests\n\nAll tests are written with [vows][0] and should be run with [npm][1]:\n\n``` bash\n  $ npm test\n```\n\n#### Author: Richard Marr\n#### License: Apache 2.0\n\n\n[0]: http://vowsjs.org\n[1]: http://npmjs.org\n[2]: http://flatironjs.org/\n[3]: https://github.com/flatiron/resourceful/\n[4]: http://www.elasticsearch.org","readmeFilename":"README.md","_id":"resourceful-couchelastic@0.1.7","dist":{"shasum":"36207755d16f27e6fa7a5dcff3c7538c0d07f332","tarball":"https://registry.npmjs.org/resourceful-couchelastic/-/resourceful-couchelastic-0.1.7.tgz","integrity":"sha512-+SOsn34NyOOOPwCt0pqFjtRfY+ex4Fr6nJWy/TyvSRnVc5gg0b9lQYFR4yC6oPsR3BTBnvt2ZxwgvJh5ps8dnw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQV9I4G0a3d0Csr8QSWLs2NUmfa2rSGUWMfhFJmh+myAIhAJvMSRgGuUHG/MVvQzP381z7DUwTH7g/8Rvhs51iHoD0"}]},"_npmVersion":"1.1.65","_npmUser":{"name":"richmarr","email":"richard.marr@gmail.com"},"maintainers":[{"name":"richmarr","email":"richard.marr@gmail.com"}]},"0.1.8":{"author":{"name":"Richard Marr","email":"richard.marr@gmail.com"},"name":"resourceful-couchelastic","description":"Hybrid Couchdb/Elasticsearch engine for Resourceful","version":"0.1.8","repository":{"type":"git","url":"git://github.com/richmarr/resourceful-couchelastic.git"},"main":"index.js","scripts":{"test":"vows test/offline-* --spec -i"},"engines":{"node":"~0.4.7"},"dependencies":{"resourceful-elasticsearch":"0.1.6","resourceful":"0.1.6"},"devDependencies":{"cradle":"0.5.x","vows":"~0.6.0"},"readme":"# resourceful-couchelastic [![Build Status](https://secure.travis-ci.org/richmarr/resourceful-couchelastic.png)](http://travis-ci.org/richmarr/resourceful-couchelastic)\n\nThe goal of CouchElastic is to provide seamless full-text and parametric search to Node.js apps, \naccomplished via [Flatiron][2]'s [Resourceful][3] ODM layer and the awesome power of CouchDB and [Elasticsearch][4]. \n\n\n## Configuration\n\nStart up an empty instance of CouchDB and an empty instance of Elasticsearch, then do this:\n\n``` js\n\tvar resourceful = require('resourceful'),\n\t\tCouchelastic = require('resourceful-couchelastic').Couchelastic;\n\t\n\tresourceful.engines.Couchelastic = Couchelastic;  // patch in the engine\n\tresourceful.use( 'couchelastic', {\n\t\t// CouchDB settings\n\t\thost : 'localhost', // optional - defaults to localhost\n\t\tport : 5984,        // optional - defaults to 5984\n\t\tdatabase:'db-name', // required\n\t\tsearch:{\n\t\t\t// Elasticsearch settings\n\t\t\tindex:'my-index-name'  // optional - defaults to db name\n\t\t}\n\t});\n```\n\nFrom this point onwards each `Resource` that you define will have its data stored in your specified \nCouchDB cluster and have an Elasticsearch indexing river configured to index the data for searching.\n\n## Define a resource\n\nAssuming you're already defining resources with Resourceful nothing more is required, but there are some additional options you might want to use. \nEverything specified within the options.search is passed straight into ES's Mapping API, allowing you fine-grained control over how that individual \nfield is treated in the index.\n\n``` js\n\tvar Creature = resourceful.define('Creature', function(){\n\t\tthis.string('name',{ required:true });\n\t\tthis.string('genus');\n\t\tthis.number('population');\n\t\tthis.number('legs',{\n\t\t\trequired: true,        // validation rules\n\t\t\tminimum: 0,\n\t\t\tsearch:{               \n\t\t\t\ttype:'integer'       // this tells ES what type of number this is\n\t\t\t}\n\t\t});\n\t\tthis.array('eats',{\n\t\t\tsearch:{ type:'string' }\n\t\t});\n\t\tthis.string('geography',{\n\t\t\tsearch:{\n\t\t\t\tanalyzer:'snowball'  // stem words to match word stem rather than exact form.\n\t\t\t}\n\t\t});\n\t});\n```\n\n## Synchronise your schema\n\nThe `sync()` method sets up your data sources for you. Until you sync you can `save()` and `get()` but not much more. \n\nFor each `Resource` type `sync` does the following:\n\n * Saves a CouchDB design document \n * Saves an Elasticsearch Mapping document\n * Creates a River on the Elasticsearch cluster that listens to CouchDB's replication stream\n\nYou'll need to `sync` after you make any significant design changes so that they're carried through to the schemas of both servers. Be aware that changing the data type of a field after data has already been indexed can be problematic.\n\n## Searching\n\nAssuming you've defined a Creature as per the Resourceful docs you should be able to search your database in free text like this.\n\n``` js\n\tCreature.search(\"fur\",function( err, creatures, response ){\n\t\t// creatures is a convenient array of Creature objects that match the search\n\t\t// response contains the entire ES response including search results and metadata\n\t});\n```\n\nYou can also search using the Elasticsearch query DSL, for example the following `fuzzy` query would also match the word \"oscar\"\n\n``` js\n\tActor.search({\n\t\tquery : {\n    \t\tfuzzy : { text : \"socar\" }\t\n\t\t}\n\t},function( err, actors, response ){\n\t\t// actors is an array\n\t\t// response is the full response containing metadata, e.g. facets\n\t});\n```\n\nOr using Resoureceful's parametric query method `Resourece.find()`\n\n``` js\n\tCreature.find({\n\t\tlegs:4,\n\t\teats:\"wasps\"\n\t},function( err, creatures, response ){\n\t\t// \n\t});\n```\n### Joining\n\nIf you have two data types related by a one-to-many foreign key you can do this (many-many not available yet): \n\n``` js\n\tCreature.search(\"name:wolf\",function( err, creatures ){\n\t\tGenus.join( creatures, function( err, creatures ){\n\t\t\t// creatures now contains:\n\t\t\t//     creature.genus_id - foreign key\n\t\t\t//     creature.genus - linked entity\n\t\t});\n\t});\n```\n\n### Security\n\nIf some of your Resource data is sensitive you might want to block it from being indexed\n\n``` js\n\tvar Employee = resourceful.define('Employee', function(){\n\t\tthis.string('name');\n\t\tthis.number('salary',{search:{index:'no'}});\n\t});\n```\n\n\n\nTODO - clean up the object search API and allow faceting etc.\n\n## Installation\n\n``` bash\n\tnpm install resourceful-couchelastic`\n```\n\n## Tests\n\nAll tests are written with [vows][0] and should be run with [npm][1]:\n\n``` bash\n  $ npm test\n```\n\n#### Author: Richard Marr\n#### License: Apache 2.0\n\n\n[0]: http://vowsjs.org\n[1]: http://npmjs.org\n[2]: http://flatironjs.org/\n[3]: https://github.com/flatiron/resourceful/\n[4]: http://www.elasticsearch.org","readmeFilename":"README.md","_id":"resourceful-couchelastic@0.1.8","dist":{"shasum":"c16831bde5ac85cfd42a8d91c11f7583b2f763b4","tarball":"https://registry.npmjs.org/resourceful-couchelastic/-/resourceful-couchelastic-0.1.8.tgz","integrity":"sha512-Op9+QN8HfAIEcqmlRx4sN8xmVhbeBe2SpKdVnyT9Kr+Jhb1Typa3RvpJHxjRRQFuKt8RbPdT9ryWPZYmxzq+vA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFVkPN+RkifPnBmtJm7DXQL4dOILfR0N1Jq5ZJRz8DjcAiB9g5GcyAudDls8Gymgx2uikfhtcFm9o/QvCvs8YXIGww=="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"richmarr","email":"richard.marr@gmail.com"},"maintainers":[{"name":"richmarr","email":"richard.marr@gmail.com"}]}},"readme":"# resourceful-couchelastic\n\nThe goal of CouchElastic is to provide seamless full-text and parametric search to Node.js apps, \naccomplished via [Flatiron][2]'s [Resourceful][3] ODM layer and the awesome power of CouchDB and [Elasticsearch][4]. \n\n\n## Configuration\n\nStart up an empty instance of CouchDB and an empty instance of Elasticsearch, then do this:\n\n``` js\n\tvar resourceful = require('resourceful'),\n\t\tCouchelastic = require('resourceful-couchelastic').Couchelastic;\n\n\tresourceful.use('couchelastic',{\n\t\tdatabase:'couchelastic-sync-test'\n\t});\n```\n\nFrom this point onwards each `Resource` that you define will have its data stored in your specified \nCouchDB cluster and have an Elasticsearch indexing river configured to index the data for searching.\n\n## Define a resource\n\nAssuming you're already defining resources with Resourceful nothing more is required, but there are some additional optional you might want to use.\n\n### Security\n\nIf some of your Resource data is sensitive you might want to block it from being indexed\n\n``` js\n\tvar Employee = resourceful.define('Employee', function(){\n\t\tthis.string('name');\n\t\tthis.number('salary',{searchable:false});\n\t});\n```\n\nTODO - maybe just pass through mapping options transparently for flexibility\n\n## Searching\n\nAssuming you've defined a Creature as per the Resourceful docs you should be able to search your database in free text like this.\n\n``` js\n\tCreature.search(\"fur\",function(err,creatures){\n\t\t// creatures is an array of Creature objects that match the search\n\t});\n```\n\nYou can also search using the Elasticsearch query DSL\n\n``` js\n\tCreature.search({\n\t\tterm:{\n\t\t\tlegs:4,\n\t\t\teats:\"wasps\"\n\t\t}\n\t},function(err,creatures){\n\t\t// creatures is an array of Creature objects that match the search\n\t});\n```\n\nTODO - clean up the object search API and allow faceting etc.\n\n## Installation\n\n``` bash\n\tnpm install resourceful-couchelastic`\n```\n\n## Tests\n\nAll tests are written with [vows][0] and should be run with [npm][1]:\n\n``` bash\n  $ npm test\n```\n\n#### Author: Richard Marr\n#### License: Apache 2.0\n\n\n[0]: http://vowsjs.org\n[1]: http://npmjs.org\n[2]: http://flatironjs.org/\n[3]: https://github.com/flatiron/resourceful/\n[4]: http://www.elasticsearch.org","maintainers":[{"name":"richmarr","email":"richard.marr@gmail.com"}],"time":{"modified":"2022-06-26T11:56:27.343Z","created":"2012-01-11T21:07:38.232Z","0.0.2":"2012-01-11T21:07:38.925Z","0.0.3":"2012-01-12T15:03:18.061Z","0.0.4":"2012-01-16T20:16:11.192Z","0.0.5":"2012-01-17T23:24:44.881Z","0.0.6":"2012-01-23T23:53:04.154Z","0.0.7":"2012-01-31T12:50:44.653Z","0.0.8":"2012-01-31T14:16:14.690Z","0.0.9":"2012-02-06T11:37:27.687Z","0.0.10":"2012-02-18T14:44:58.438Z","0.0.11":"2012-02-28T15:25:42.785Z","0.0.12":"2012-03-13T21:03:18.641Z","0.0.13":"2012-03-21T22:50:12.014Z","0.1.1":"2013-05-20T03:20:10.255Z","0.1.2":"2013-05-20T04:17:14.341Z","0.1.3":"2013-05-20T13:19:17.869Z","0.1.4":"2013-05-20T17:08:30.531Z","0.1.5":"2013-05-20T19:42:19.050Z","0.1.6":"2013-05-22T11:35:03.639Z","0.1.7":"2013-05-29T16:15:28.558Z","0.1.8":"2013-05-29T20:43:03.853Z"},"author":{"name":"Richard Marr","email":"richard.marr@gmail.com"},"repository":{"type":"git","url":"git://github.com/richmarr/resourceful-couchelastic.git"}}