Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
marsanla committed Dec 9, 2014
0 parents commit 1992d9f
Show file tree
Hide file tree
Showing 14 changed files with 993 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# editorconfig.org
root = true

[*]
indent_style = tab
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.\#*
*#
node_modules
ssl
.DS_STORE
*~
.idea
nbproject
npm-debug.log
34 changes: 34 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
// To fix column positions for JSHint errors you may want to add `"indent": 1` to your
// **User** "jshint_options". This issue affects users with tabs for indentation.
// This fix was reverted due to a conflict with using the `"white": true` option.
// "indent": 1,
"evil": true,
"regexdash": true,
"browser": true,
"wsh": true,
"sub": true,

// Suppress warnings about mixed tabs and spaces
"smarttabs": true,

// Suppress warnings about trailing whitespace
"trailing": false,

// Suppress warnings about the use of expressions where fn calls or assignments are expected
"expr": true,

// Suppress warnings about using functions inside loops (useful for inifinityCounters)
"loopfunc": true,

// Suppress warnings about using assignments where conditionals are expected
"boss": true,

// Suppress warnings about "weird constructions"
// i.e. allow code like:
// (new (function OneTimeUsePrototype () { } ))
"supernew": true,

// Allow backwards, node-dependency-style commas
"laxcomma": true
}
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
language: node_js
node_js:
- "0.11"
- "0.10"
- "0.8"
services:
- elasticsearch
27 changes: 27 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Contributing to waterline-elasticsearch


## Opening Issues

Please observe the same conventions as you would opening issues in the main Sails repo.

See [Opening Issues](https://github.com/balderdashy/sails/blob/master/CONTRIBUTING.md#opening-issues) for more information.



## Submitting Pull Requests

Please observe the same conventions as you would submitting pull requests to the Sails core.

See [Submitting Pull Requests](https://github.com/balderdashy/sails/blob/master/CONTRIBUTING.md#submitting-pull-requests).



## Need more help?

Please see the [contribution guide](https://github.com/balderdashy/sails/blob/v0.10/CONTRIBUTING.md#contributing-to-a-generator) in the Sails repo for more general guidelines.


[![githalytics.com alpha](https://cruel-carlota.pagodabox.com/8acf2fc2ca0aca8a3018e355ad776ed7 "githalytics.com")](http://githalytics.com/balderdashy/waterline-elasticsearch/CONTRIBUTING.md)


Empty file added LICENSE
Empty file.
167 changes: 167 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
![[email protected]](http://i.imgur.com/RIvu9.png)

# waterline-elasticsearch

Provides easy access to `elasticsearch` from Sails.js & Waterline.

This module is a Waterline/Sails adapter, an early implementation of a rapidly-developing, tool-agnostic data standard. Its goal is to provide a set of declarative interfaces, conventions, and best-practices for integrating with all sorts of data sources. Not just databases-- external APIs, proprietary web services, or even hardware.

Strict adherence to an adapter specification enables the (re)use of built-in generic test suites, standardized documentation, reasonable expectations around the API for your users, and overall, a more pleasant development experience for everyone.


### Installation

To install this adapter, run:

```sh
$ npm install waterline-elasticsearch
```


### Configuration

```js
{
adapter: 'sails-elasticsearch',
hosts: ['http://127.0.0.1:9200'],
keepAlive: false,
sniffOnStart: true,
maxRetries: 10,
deadTimeout: 40000,
sniffOnConnectionFault: true,
apiVersion: '1.3'
},
```


### Usage

This adapter exposes the following methods:

###### `search()`

+ **Status**
+ Done

###### `createIndex()`

+ **Status**
+ Done

###### `updateIndex()`

+ **Status**
+ Done

###### `destroyIndex()`

+ **Status**
+ Done

###### `countIndex()`

+ **Status**
+ Done

###### `bulk()`

+ **Status**
+ Done



### Interfaces

>TODO:
>Specify the interfaces this adapter will support.
>e.g. `This adapter implements the [semantic]() and [queryable]() interfaces.`
> For more information, check out this repository's [FAQ](./FAQ.md) and the [adapter interface reference](https://github.com/balderdashy/sails-docs/blob/master/adapter-specification.md) in the Sails docs.

### Development

Check out **Connections** in the Sails docs, or see the `config/connections.js` file in a new Sails project for information on setting up adapters.

## Getting started
It's usually pretty easy to add your own adapters for integrating with proprietary systems or existing open APIs. For most things, it's as easy as `require('some-module')` and mapping the appropriate methods to match waterline semantics. To get started:

1. Fork this repository
2. Set up your `README.md` and `package.json` file. Sails.js adapter module names are of the form sails-*, where * is the name of the datastore or service you're integrating with.
3. Build your adapter.




### Running the tests

Configure the interfaces you plan to support (and targeted version of Sails/Waterline) in the adapter's `package.json` file:

```javascript
{
//...
"sails": {
"adapter": {
"sailsVersion": "~0.10.0",
"implements": [
"semantic",
"queryable"
]
}
}
}
```

In your adapter's directory, run:

```sh
$ npm test
```


## Publish your adapter

> You're welcome to write proprietary adapters and use them any way you wish--
> these instructions are for releasing an open-source adapter.
1. Create a [new public repo](https://github.com/new) and add it as a remote (`git remote add origin [email protected]:yourusername/sails-youradaptername.git)
2. Make sure you attribute yourself as the author and set the license in the package.json to "MIT".
3. Run the tests one last time.
4. Do a [pull request to sails-docs](https://github.com/balderdashy/sails-docs/compare/) adding your repo to `data/adapters.js`. Please let us know about any special instructions for usage/testing.
5. We'll update the documentation with information about your new adapter
6. Then everyone will adore you with lavish praises. Mike might even send you jelly beans.

7. Run `npm version patch`
8. Run `git push && git push --tags`
9. Run `npm publish`




### Questions?

See [`FAQ.md`](./FAQ.md).



### More Resources

- [Stackoverflow](http://stackoverflow.com/questions/tagged/sails.js)
- [#sailsjs on Freenode](http://webchat.freenode.net/) (IRC channel)
- [Twitter](https://twitter.com/sailsjs)
- [Professional/enterprise](https://github.com/balderdashy/sails-docs/blob/master/FAQ.md#are-there-professional-support-options)
- [Tutorials](https://github.com/balderdashy/sails-docs/blob/master/FAQ.md#where-do-i-get-help)
- <a href="http://sailsjs.org" target="_blank" title="Node.js framework for building realtime APIs."><img src="https://github-camo.global.ssl.fastly.net/9e49073459ed4e0e2687b80eaf515d87b0da4a6b/687474703a2f2f62616c64657264617368792e6769746875622e696f2f7361696c732f696d616765732f6c6f676f2e706e67" width=60 alt="Sails.js logo (small)"/></a>


### License

**[MIT](./LICENSE)**
&copy; 2014 [balderdashy](http://github.com/balderdashy) & [contributors]
[Mike McNeil](http://michaelmcneil.com), [Balderdash](http://balderdash.co) & contributors

[Sails](http://sailsjs.org) is free and open-source under the [MIT License](http://sails.mit-license.org/).


[![githalytics.com alpha](https://cruel-carlota.pagodabox.com/8acf2fc2ca0aca8a3018e355ad776ed7 "githalytics.com")](http://githalytics.com/balderdashy/waterline-elasticsearch/README.md)


Loading

0 comments on commit 1992d9f

Please sign in to comment.