Documentation about the plugin
Just like any other Grails plugin, through the Grails Plugin center.
Edit your project's build.gradle file, by adding the plugin's dependency declaration:
build.gradle:
dependencies {
...
implementation "org.grails.plugins:grails-elasticsearch:5.0.0"
...
}build.gradle:
dependencies {
...
implementation "org.grails.plugins:elasticsearch:4.0.0"
...
}In order to simply the versioning, with v3.0.0.M1 the Elasticsearch Grails plugin is using Semantic Versioning 2.0.0. To understand what that means, please see the specification documentation.
The plugin version is neither tied to the Grails release nor the Elasticsearch client API used. Often it is possible to connect to newer Elasticsearch servers if you do not require the new features.
| Plugin Version | Grails Version | Elasticsearch Client API Version |
|---|---|---|
| 5.0.0 | 7.x | 7.17.29 |
| 4.0.0 | 5.3.x - 6.x.x | 7.17.29 |
| 3.0.0 | 4.0.x - 6.x.x | 7.8.0 |
| 2.7.0 | 3.3.x | 7.3.0 |
| 2.5.0 | 3.3.x | 5.5.3 |
| 2.4.2 | 3.3.y | 5.4.3 |
| 2.4.1 | 3.3.x | 5.4.3 |
| 2.4.0 | 3.3.y | 5.4.3 |
| 1.4.1 | 3.1.y | 5.4.1 |
| 1.2.1 | 3.2.y | 2.3.z |
| 1.2.0 | 3.1.y | 2.3.z |
| 1.0.0.x | 3.1.y | 1.6.z |
| 0.1.0.x | 2.y | 2.1.z |
| 0.0.4.x | 2.y | 1.6.z |
In the following we demonstrate two example configurations using Hibernate or MongoDB as a datastore.
Check out the example application in this repository on using Elasticsearch in Grails 7.x with Hibernate.
Add the following to your grails-app/conf/application.yml:
elasticSearch:
plugin:
mapperAttachment:
enabled: false
client:
mode: transport
hosts:
- {host: localhost, port: 9200}
cluster.name: elasticsearch
bulkIndexOnStartup: true
datastoreImpl: hibernateDatastoreAdd the MongoDB dependency to build.gradle:
dependencies {
compile 'org.grails.plugins:mongodb:7.0.0'
}And the configuration to grails-app/conf/application.yml:
elasticSearch:
plugin:
mapperAttachment:
enabled: false
client:
mode: transport
hosts:
- {host: localhost, port: 9200}
cluster.name: elasticsearch
bulkIndexOnStartup: true
datastoreImpl: mongoDatastoreThis project is a fork based on the great work done by the guys at:
- https://github.com/mstein/elasticsearch-grails-plugin
- https://github.com/noamt/elasticsearch-grails-plugin
The original Elasticsearch plugin relies on Hibernate-specific GORM components, thus rendering it unusable if you back your Grails application by any other database.
_,,,_
.-'` ( '.
.-' ,_ ; \___ _,
__.' ) \'.__.'(:;'.__.'/
__..--"" ( '.__{':');}__.'
.' ( ; ( .-|` ' |-.
/ ( ) ) '-p q-'
( ; ; ; ; |.---.|
) ( ( ; \ o o)
| ) ; | ) ) /'.__/
) ; ) ; | ; //
( ) _,\ ; //
; ( ,_,,-~""~`"" \ ( //
\_.'\\_ '. /<_
\\_)--\ \ \--\
jgs )--\""` )--\"`
`""` `""`