Skip to content

Commit

Permalink
Merge pull request #138 from puneetbehl/master
Browse files Browse the repository at this point in the history
Ported to Grails 3
  • Loading branch information
puneetbehl committed Feb 5, 2016
2 parents 23cb44c + 208600c commit 46811ca
Show file tree
Hide file tree
Showing 98 changed files with 1,658 additions and 1,677 deletions.
32 changes: 25 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
.idea
# JetBrains IntelliJ IDEA files
.idea/
*.iml
out
data
target
.link_to_grails_plugins
web-app
*.iws
.gradle
build/

# Log files
*.log

# Libraries and others
*.zip
.svn

# Target
target/
target-eclipse/

.DS_Store

/docs/
plugin.xml
/docs
.settings

# Unused grails files
.classpath
.project
test/reports
data/
16 changes: 9 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
language: groovy
script: ./grailsw refresh-dependencies
&& ./grailsw clean
&& ./grailsw compile
&& ./grailsw test-app
branches:
only:
- master
jdk:
- oraclejdk7
before_script:
- rm -rf target
script: travis_wait 60 ./travis-build.sh
env:
global:
- GIT_NAME="Puneet Behl"
- GIT_EMAIL="puneetbehl@yahoo.com"
193 changes: 0 additions & 193 deletions ElasticsearchGrailsPlugin.groovy

This file was deleted.

22 changes: 15 additions & 7 deletions README.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,37 @@ The original Elasticsearch plugin relies on *Hibernate-specific* GORM components
image:https://travis-ci.org/noamt/elasticsearch-grails-plugin.svg?branch=master["Build Status", link="https://travis-ci.org/noamt/elasticsearch-grails-plugin"]

Just like any other Grails plugin, through the Grails Plugin center.
Edit your project's +BuildConfig.groovy+ file, by adding the plugin's dependency declaration:
Edit your project's +build.gradle+ file, by adding the plugin's dependency declaration:

----
grails.project.dependency.resolution = {
plugins {
runtime ':elasticsearch:0.0.4.6'
}
dependencies {
...
compile "org.grails.plugins:elasticsearch-grails-plugin:1.0.0-SNAPSHOT"
...
}
----

=== Ohs Nos! I'm hitting a +java.lang.Exception: No datastore implementation specified+

This error means that you probably haven't specified your datastore type in your +Config.groovy+ file.
This error means that you probably haven't specified your datastore type in your +application.groovy+ or +application.yml+ file.
This plugin has an auto-index feature which automatically propagates any changes made to searchable Domains into the search index;
this is done by hooking into GORM's storage events but also requires a reference to the active datastore implementation.
To fix, edit your project's +Config.groovy+ file and add:
To fix, edit your project's +application.groovy+ or +application.yml+ file and add:
application.groovy
----
elasticSearch {
...
datastoreImpl = 'nameOfDatastoreBean'
...
}
----

application.yml
----
elasticSearch:
datastoreImpl: nameOfDatastoreBean
----
Where the value should be the name of the datastore bean as it is configured in the Spring context; some possible values:

MongoDB::
Expand Down
4 changes: 0 additions & 4 deletions application.properties

This file was deleted.

95 changes: 95 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
buildscript {
ext {
grailsVersion = project.grailsVersion
}
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
}
}

plugins {
id "com.jfrog.bintray" version "1.2"
}

version "1.0.0-SNAPSHOT"
group "org.grails.plugins"

apply plugin: 'maven-publish'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: "org.grails.grails-plugin"
apply plugin: "org.grails.grails-gsp"
// Used for publishing to central repository, remove if not needed
apply from:'https://raw.githubusercontent.com/grails/grails-profile-repository/master/profiles/plugin/templates/grailsCentralPublishing.gradle'
apply from:'https://raw.githubusercontent.com/grails/grails-profile-repository/master/profiles/plugin/templates/bintrayPublishing.gradle'

ext {
grailsVersion = project.grailsVersion
gradleWrapperVersion = project.gradleWrapperVersion
}

sourceCompatibility = 1.7
targetCompatibility = 1.7

repositories {
mavenLocal()
mavenCentral()
maven { url "https://repo.grails.org/grails/core" }
}

dependencyManagement {
imports {
mavenBom "org.grails:grails-bom:$grailsVersion"
}
applyMavenExclusions false
}

jar {
exclude "test/**/**"
}

dependencies {
provided 'org.springframework.boot:spring-boot-starter-logging'
provided "org.springframework.boot:spring-boot-starter-actuator"
provided "org.springframework.boot:spring-boot-autoconfigure"
provided "org.springframework.boot:spring-boot-starter-tomcat"
provided "org.grails:grails-web-boot"
provided "org.grails:grails-dependencies"

compile "org.grails:grails-core"
compile "org.grails.plugins:hibernate4"
compile "org.grails.plugins:cache"
compile "org.hibernate:hibernate-ehcache"

testRuntime('org.elasticsearch:elasticsearch-groovy:1.6.0') {
exclude module: 'groovy-all'
}
compile "org.elasticsearch:elasticsearch-mapper-attachments:2.6.0"

testRuntime 'com.spatial4j:spatial4j:0.4.1'
testCompile 'com.vividsolutions:jts:1.13'
testCompile 'com.googlecode.json-simple:json-simple:1.1.1'
testCompile "org.grails:grails-plugin-testing"

console "org.grails:grails-console"
}

task wrapper(type: Wrapper) {
gradleVersion = gradleWrapperVersion
}

check.doLast {
cleanDataDir.execute()
}

clean.doLast {
cleanDataDir.execute()
}

task cleanDataDir(type: Delete) {
delete fileTree(dir: 'data')
}
Loading

5 comments on commit 46811ca

@ivgeorgi
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,
Is there any information when this pull request will be released officially?

Iveta

@puneetbehl
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ivgeorgi This has been released already, please see https://grails.org/plugins.html#plugin/elasticsearch

@ivgeorgi
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the quick answer and sorry to bother you for this.

I commented here by mistake, in fact I'm waiting for the Support for Elasticsearch 2.x.

Thank you,
Iveta

@puneetbehl
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ivgeorgi No worries, we recently merged a pull request for Elasticsearch 2.x support for Grails 2 version which will be released soon after testing. And for Grails 3, I'll work on upgrading to Elasticsearch 2.x soon.

@ivgeorgi
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great.
This is the only stopper for me to not upgrade to Grails 3.x.

Please sign in to comment.