2 Configuration - Reference Documentation
Authors: Manuarii Stein, Stephane Maldini, Serge P. Nekoval
Version: 0.18.7.1-SNAPSHOT
2 Configuration
The plugin provide a default configuration, but you may add your own settings in your Config.groovy script.Client mode
You can set the plugin in 3 different modes, detailled on the official ElasticSearch doc. The mode is defined with the following config key:elasticSearch.client.mode = '<mode>'
| Value | Description |
|---|---|
| node | The plugin create its own node and join the ElasticSearch cluster as a client node (node.client = true). This setting requires that you have an ElasticSearch instance running and available on your network (use the discovery feature) |
| local | The plugin create its own local (to the JVM) node. Does not require any running ElasticSearch instance. Useful for development or testing. |
| transport | The plugin create a transport client that will connect to a remote ElasticSearch instance without joining the cluster. |
elasticSearch.client.hosts = [
[host:'192.168.0.3', port:9300],
[host:'228.168.0.4', port:9300]
]localhost:9300 will be used by the transport client.Others properties
elasticSearch.client.transport.sniff
elasticSearch.cluster.name
elasticSearch.date.formats
elasticSearch.defaultExcludedProperties
searchable property set to "true", and will
not be considered when using closure mapping.
elasticSearch.disableAutoIndex
false.
elasticSearch.bulkIndexOnStartup
true.
elasticSearch.index.compound_format
false by default (really applicable for file system based index storage).
More details on this setting on the ElasticSearch Documentation.
elasticSearch.index.store.type
| Possible value | Description |
|---|---|
| memory | Stores the index in memory. Useful for testing. |
| mmapfs | Stores the shard index on the file system (maps to Lucene MMapDirectory) using mmap. |
| niofs | Stores the shard index on the file system (maps to Lucene NIOFSDirectory) and allows for multiple threads to read from the same file concurrently. |
| simplefs | Stores using a plain forward implementation of file system storage (maps to Lucene SimpleFsDirectory) using random access file. |
elasticSearch.maxBulkRequest
elasticSearch.path.data
Default configuration script
Below is the default configuration loaded by the plugin (any of your settings in the Config.groovy script overwrite those).elasticSearch {
/**
* Date formats used by the unmarshaller of the JSON responses
*/
date.formats = ["yyyy-MM-dd'T'HH:mm:ss'Z'"] /**
* Hosts for remote ElasticSearch instances.
* Will only be used with the "transport" client mode.
* If the client mode is set to "transport" and no hosts are defined, ["localhost", 9300] will be used by default.
*/
client.hosts = [
[host:'localhost', port:9300]
] /**
* Default mapping property exclusions
*
* No properties matching the given names will be mapped by default
* ie, when using "searchable = true"
*
* This does not apply for classes using mapping by closure
*/
defaultExcludedProperties = ["password"] /**
* Determines if the plugin should reflect any database save/update/delete automatically
* on the ES instance. Default to false.
*/
disableAutoIndex = false /**
* Should the database be indexed at startup.
*
* The value may be a boolean true|false.
* Indexing is always asynchronous (compared to Searchable plugin) and executed after BootStrap.groovy.
*/
bulkIndexOnStartup = true /**
* Max number of requests to process at once. Reduce this value if you have memory issue when indexing a big amount of data
* at once. If this setting is not specified, 500 will be use by default.
*/
maxBulkRequest = 500
}environments {
development {
/**
* Possible values : "local", "node", "transport"
* If set to null, "node" mode is used by default.
*/
elasticSearch.client.mode = 'local'
}
test {
elasticSearch {
client.mode = 'local'
index.store.type = 'memory' // store local node in memory and not on disk
}
}
production {
elasticSearch.client.mode = 'node'
}
}