Skip to content

Commit 1992d9f

Browse files
committed
first commit
0 parents  commit 1992d9f

14 files changed

+993
-0
lines changed

.editorconfig

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = tab
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true

.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.\#*
2+
*#
3+
node_modules
4+
ssl
5+
.DS_STORE
6+
*~
7+
.idea
8+
nbproject
9+
npm-debug.log

.jshintrc

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
// To fix column positions for JSHint errors you may want to add `"indent": 1` to your
3+
// **User** "jshint_options". This issue affects users with tabs for indentation.
4+
// This fix was reverted due to a conflict with using the `"white": true` option.
5+
// "indent": 1,
6+
"evil": true,
7+
"regexdash": true,
8+
"browser": true,
9+
"wsh": true,
10+
"sub": true,
11+
12+
// Suppress warnings about mixed tabs and spaces
13+
"smarttabs": true,
14+
15+
// Suppress warnings about trailing whitespace
16+
"trailing": false,
17+
18+
// Suppress warnings about the use of expressions where fn calls or assignments are expected
19+
"expr": true,
20+
21+
// Suppress warnings about using functions inside loops (useful for inifinityCounters)
22+
"loopfunc": true,
23+
24+
// Suppress warnings about using assignments where conditionals are expected
25+
"boss": true,
26+
27+
// Suppress warnings about "weird constructions"
28+
// i.e. allow code like:
29+
// (new (function OneTimeUsePrototype () { } ))
30+
"supernew": true,
31+
32+
// Allow backwards, node-dependency-style commas
33+
"laxcomma": true
34+
}

.travis.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
language: node_js
2+
node_js:
3+
- "0.11"
4+
- "0.10"
5+
- "0.8"
6+
services:
7+
- elasticsearch

CONTRIBUTING.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Contributing to waterline-elasticsearch
2+
3+
4+
## Opening Issues
5+
6+
Please observe the same conventions as you would opening issues in the main Sails repo.
7+
8+
See [Opening Issues](https://github.com/balderdashy/sails/blob/master/CONTRIBUTING.md#opening-issues) for more information.
9+
10+
11+
12+
## Submitting Pull Requests
13+
14+
Please observe the same conventions as you would submitting pull requests to the Sails core.
15+
16+
See [Submitting Pull Requests](https://github.com/balderdashy/sails/blob/master/CONTRIBUTING.md#submitting-pull-requests).
17+
18+
19+
20+
## Need more help?
21+
22+
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.
23+
24+
25+
[![githalytics.com alpha](https://cruel-carlota.pagodabox.com/8acf2fc2ca0aca8a3018e355ad776ed7 "githalytics.com")](http://githalytics.com/balderdashy/waterline-elasticsearch/CONTRIBUTING.md)
26+
27+

LICENSE

Whitespace-only changes.

README.md

+167
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
![[email protected]](http://i.imgur.com/RIvu9.png)
2+
3+
# waterline-elasticsearch
4+
5+
Provides easy access to `elasticsearch` from Sails.js & Waterline.
6+
7+
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.
8+
9+
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.
10+
11+
12+
### Installation
13+
14+
To install this adapter, run:
15+
16+
```sh
17+
$ npm install waterline-elasticsearch
18+
```
19+
20+
21+
### Configuration
22+
23+
```js
24+
{
25+
adapter: 'sails-elasticsearch',
26+
hosts: ['http://127.0.0.1:9200'],
27+
keepAlive: false,
28+
sniffOnStart: true,
29+
maxRetries: 10,
30+
deadTimeout: 40000,
31+
sniffOnConnectionFault: true,
32+
apiVersion: '1.3'
33+
},
34+
```
35+
36+
37+
### Usage
38+
39+
This adapter exposes the following methods:
40+
41+
###### `search()`
42+
43+
+ **Status**
44+
+ Done
45+
46+
###### `createIndex()`
47+
48+
+ **Status**
49+
+ Done
50+
51+
###### `updateIndex()`
52+
53+
+ **Status**
54+
+ Done
55+
56+
###### `destroyIndex()`
57+
58+
+ **Status**
59+
+ Done
60+
61+
###### `countIndex()`
62+
63+
+ **Status**
64+
+ Done
65+
66+
###### `bulk()`
67+
68+
+ **Status**
69+
+ Done
70+
71+
72+
73+
### Interfaces
74+
75+
>TODO:
76+
>Specify the interfaces this adapter will support.
77+
>e.g. `This adapter implements the [semantic]() and [queryable]() interfaces.`
78+
> 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.
79+
80+
81+
### Development
82+
83+
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.
84+
85+
## Getting started
86+
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:
87+
88+
1. Fork this repository
89+
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.
90+
3. Build your adapter.
91+
92+
93+
94+
95+
### Running the tests
96+
97+
Configure the interfaces you plan to support (and targeted version of Sails/Waterline) in the adapter's `package.json` file:
98+
99+
```javascript
100+
{
101+
//...
102+
"sails": {
103+
"adapter": {
104+
"sailsVersion": "~0.10.0",
105+
"implements": [
106+
"semantic",
107+
"queryable"
108+
]
109+
}
110+
}
111+
}
112+
```
113+
114+
In your adapter's directory, run:
115+
116+
```sh
117+
$ npm test
118+
```
119+
120+
121+
## Publish your adapter
122+
123+
> You're welcome to write proprietary adapters and use them any way you wish--
124+
> these instructions are for releasing an open-source adapter.
125+
126+
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)
127+
2. Make sure you attribute yourself as the author and set the license in the package.json to "MIT".
128+
3. Run the tests one last time.
129+
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.
130+
5. We'll update the documentation with information about your new adapter
131+
6. Then everyone will adore you with lavish praises. Mike might even send you jelly beans.
132+
133+
7. Run `npm version patch`
134+
8. Run `git push && git push --tags`
135+
9. Run `npm publish`
136+
137+
138+
139+
140+
### Questions?
141+
142+
See [`FAQ.md`](./FAQ.md).
143+
144+
145+
146+
### More Resources
147+
148+
- [Stackoverflow](http://stackoverflow.com/questions/tagged/sails.js)
149+
- [#sailsjs on Freenode](http://webchat.freenode.net/) (IRC channel)
150+
- [Twitter](https://twitter.com/sailsjs)
151+
- [Professional/enterprise](https://github.com/balderdashy/sails-docs/blob/master/FAQ.md#are-there-professional-support-options)
152+
- [Tutorials](https://github.com/balderdashy/sails-docs/blob/master/FAQ.md#where-do-i-get-help)
153+
- <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>
154+
155+
156+
### License
157+
158+
**[MIT](./LICENSE)**
159+
&copy; 2014 [balderdashy](http://github.com/balderdashy) & [contributors]
160+
[Mike McNeil](http://michaelmcneil.com), [Balderdash](http://balderdash.co) & contributors
161+
162+
[Sails](http://sailsjs.org) is free and open-source under the [MIT License](http://sails.mit-license.org/).
163+
164+
165+
[![githalytics.com alpha](https://cruel-carlota.pagodabox.com/8acf2fc2ca0aca8a3018e355ad776ed7 "githalytics.com")](http://githalytics.com/balderdashy/waterline-elasticsearch/README.md)
166+
167+

0 commit comments

Comments
 (0)