This is an Arrow connector for Elasticsearch.
$ appc install connector/appc.elasticsearch
If you wish to simply use the default Arrow CRUD operations, you can create and extend your own models:
var User = Arrow.Model.extend('user', {
fields: {
name: { type: String, required: false, validator: /[a-zA-Z]{3,}/ }
},
connector: 'appc.elasticsearch'
});
Example configurations can be found in conf/
. You can set any of the following on the connector:
- configuration
- the configuration settings to pass to the internal Elasticsearch client, as described here.
- disableAnalysis
- by default, indexed strings are set to not analyzed in the Elasticsearch mappings (see Mappings).
- index
- the main index to use inside Elasticsearch (defaults to
default
). arrow:
is prepended to this index name in order to differentiate better between Arrow and non-Arrow indices.
- the main index to use inside Elasticsearch (defaults to
- refreshOnCreate
- whether to refresh the Elasticsearch index on a CU operation (defaults to
false
).
- whether to refresh the Elasticsearch index on a CU operation (defaults to
- refreshOnDelete
- whether to refresh the Elasticsearch index on a D operation (defaults to
false
).
- whether to refresh the Elasticsearch index on a D operation (defaults to
- refresh
- whether to refresh the Elasticsearch index on any operations (defaults to
false
). - if true, this will override both
refreshOnCreate
andrefreshOnDelete
.
- whether to refresh the Elasticsearch index on any operations (defaults to
In addition, any of the following can also be set on Models themselves. These values override the connector-specified values where applicable:
- index
- specified index for the given model (defaults to connector value).
- type
- the type the model should be placed in (defaults to model name).
- refresh(onCreate|onDelete)
- whether to refresh after certain operations on this model (defaults to connector values).
In order to avoid any unexpected behaviour, the connector binds a template to Elasticsearch (on indices matching arrow:*
) to disable String analysis.
If you wish to maintain String analysis, you can set disableAnalysis
to true in the connector config.
This section is for individuals developing the Elasticsearch Connector and not intended for end-users.
$ npm install
$ node app.js
When running the tests remember that appc.elasticsearch will use the index arrow:test
for testing and will empty it. You can override this using the TEST_INDEX
environment variable if needed.
$ npm test
This project is open source and licensed under the Apache Public License (version 2). Please consider forking this project to improve, enhance or fix issues. If you feel like the community will benefit from your fork, please open a pull request.
To protect the interests of the contributors, Appcelerator, customers and end users we require contributors to sign a Contributors License Agreement (CLA) before we pull the changes into the main repository. Our CLA is simple and straightforward - it requires that the contributions you make to any Appcelerator open source project are properly licensed and that you have the legal authority to make those changes. This helps us significantly reduce future legal risk for everyone involved. It is easy, helps everyone, takes only a few minutes, and only needs to be completed once.
You can digitally sign the CLA online. Please indicate your email address in your first pull request so that we can make sure that will locate your CLA. Once you've submitted it, you no longer need to send one for subsequent submissions.
Appcelerator is a registered trademark of Appcelerator, Inc. Arrow and associated marks are trademarks of Appcelerator. All other marks are intellectual property of their respective owners. Please see the LEGAL information about using our trademarks, privacy policy, terms of usage and other legal information at http://www.appcelerator.com/legal.