From 537385323dee0689cbfdc57de46a2065edba29a2 Mon Sep 17 00:00:00 2001 From: Nicolas Boire Date: Wed, 27 Jun 2012 10:18:53 +0200 Subject: [PATCH 1/6] Add default conf module with conf/reference.conf upgrade to play2.0.2 --- .gitignore | 2 ++ module/conf/reference.conf | 17 +++++++++++++++++ module/project/Build.scala | 4 ++-- module/project/build.properties | 2 +- module/project/plugins.sbt | 2 +- .../elasticsearch-java/project/build.properties | 2 +- samples/elasticsearch-java/project/plugins.sbt | 2 +- 7 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 module/conf/reference.conf diff --git a/.gitignore b/.gitignore index b1b781c..dbd734d 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,8 @@ *.ear .DS_Store +.idea +.settings *.iml *.ipr *.iws diff --git a/module/conf/reference.conf b/module/conf/reference.conf new file mode 100644 index 0000000..9865705 --- /dev/null +++ b/module/conf/reference.conf @@ -0,0 +1,17 @@ +## ElasticSearch Configuration +############################## +## define local mode or not +elasticsearch.local=true + +## list clients +#elasticsearch.client="192.168.0.46:9300" +# ex : elasticsearch.client="192.168.0.46:9300,192.168.0.47:9300" + +## Name of the index +elasticsearch.index.name="play2-elasticsearch" + +## define package or class separate by commas for loading @IndexType and @IndexMapping information +elasticsearch.index.clazzs="indexing.*" + +## show request & result json of search request in log +elasticsearch.index.show_request=true \ No newline at end of file diff --git a/module/project/Build.scala b/module/project/Build.scala index 0550148..57fa537 100644 --- a/module/project/Build.scala +++ b/module/project/Build.scala @@ -5,7 +5,7 @@ import PlayProject._ object ApplicationBuild extends Build { val appName = "elasticsearch" - val appVersion = "0.3.1" + val appVersion = "0.3.2" val appDependencies = Seq( // Add your project dependencies here @@ -16,4 +16,4 @@ object ApplicationBuild extends Build { organization := "com.github.cleverage" ) -} +} \ No newline at end of file diff --git a/module/project/build.properties b/module/project/build.properties index f4ff7a5..d428711 100644 --- a/module/project/build.properties +++ b/module/project/build.properties @@ -1 +1 @@ -sbt.version=0.11.2 +sbt.version=0.11.3 diff --git a/module/project/plugins.sbt b/module/project/plugins.sbt index 88db79f..398102a 100644 --- a/module/project/plugins.sbt +++ b/module/project/plugins.sbt @@ -5,4 +5,4 @@ logLevel := Level.Warn resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/" // Use the Play sbt plugin for Play projects -addSbtPlugin("play" % "sbt-plugin" % "2.0") \ No newline at end of file +addSbtPlugin("play" % "sbt-plugin" % "2.0.2") \ No newline at end of file diff --git a/samples/elasticsearch-java/project/build.properties b/samples/elasticsearch-java/project/build.properties index f4ff7a5..d428711 100644 --- a/samples/elasticsearch-java/project/build.properties +++ b/samples/elasticsearch-java/project/build.properties @@ -1 +1 @@ -sbt.version=0.11.2 +sbt.version=0.11.3 diff --git a/samples/elasticsearch-java/project/plugins.sbt b/samples/elasticsearch-java/project/plugins.sbt index 88db79f..398102a 100644 --- a/samples/elasticsearch-java/project/plugins.sbt +++ b/samples/elasticsearch-java/project/plugins.sbt @@ -5,4 +5,4 @@ logLevel := Level.Warn resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/" // Use the Play sbt plugin for Play projects -addSbtPlugin("play" % "sbt-plugin" % "2.0") \ No newline at end of file +addSbtPlugin("play" % "sbt-plugin" % "2.0.2") \ No newline at end of file From 6295900c25236f1237afdcc5ea370a9a1a99a45c Mon Sep 17 00:00:00 2001 From: Nicolas Boire Date: Wed, 27 Jun 2012 12:14:21 +0200 Subject: [PATCH 2/6] Update play version to 2.0.2 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7be3011..d2f224f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: java env: - - PLAY_VERSION=2.0 + - PLAY_VERSION=2.0.2 before_script: - wget http://download.playframework.org/releases/play-${PLAY_VERSION}.zip - unzip -q play-${PLAY_VERSION}.zip From 6c8683679cf2efcdc1fec3c8d41b58b138a0d49e Mon Sep 17 00:00:00 2001 From: Nicolas Boire Date: Thu, 13 Sep 2012 13:19:48 +0200 Subject: [PATCH 3/6] Plugin : stop client only if exists --- .../cleverage/elasticsearch/plugin/IndexPlugin.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/module/app/com/github/cleverage/elasticsearch/plugin/IndexPlugin.java b/module/app/com/github/cleverage/elasticsearch/plugin/IndexPlugin.java index 4cc4f98..c9b78af 100644 --- a/module/app/com/github/cleverage/elasticsearch/plugin/IndexPlugin.java +++ b/module/app/com/github/cleverage/elasticsearch/plugin/IndexPlugin.java @@ -52,10 +52,12 @@ public void onStart() @Override public void onStop() { - try { - client.stop(); - } catch (Exception e) { - Logger.error("ElasticSearch : error when stop plugin ",e); + if(client!= null) { + try { + client.stop(); + } catch (Exception e) { + Logger.error("ElasticSearch : error when stop plugin ",e); + } } Logger.info("ElasticSearch : Plugin has stopped"); } From 1209a28b7aff2fcdad0b04ed654c9f51d5f7d010 Mon Sep 17 00:00:00 2001 From: Nicolas Boire Date: Wed, 3 Oct 2012 11:30:05 +0200 Subject: [PATCH 4/6] Upgrade ES to v0.19.9 --- module/project/Build.scala | 5 +++-- samples/elasticsearch-java/project/Build.scala | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/module/project/Build.scala b/module/project/Build.scala index 57fa537..cc96a4c 100644 --- a/module/project/Build.scala +++ b/module/project/Build.scala @@ -9,11 +9,12 @@ object ApplicationBuild extends Build { val appDependencies = Seq( // Add your project dependencies here - "org.elasticsearch" % "elasticsearch" % "0.19.4" + "org.elasticsearch" % "elasticsearch" % "0.19.9" ) val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA).settings( - organization := "com.github.cleverage" + organization := "com.github.cleverage", + resolvers += "oss sonytape (release)" at "http://oss.sonatype.org/content/repositories/releases/" ) } \ No newline at end of file diff --git a/samples/elasticsearch-java/project/Build.scala b/samples/elasticsearch-java/project/Build.scala index 1b0d535..b3546fd 100644 --- a/samples/elasticsearch-java/project/Build.scala +++ b/samples/elasticsearch-java/project/Build.scala @@ -9,7 +9,7 @@ object ApplicationBuild extends Build { val appDependencies = Seq( // Add your project dependencies here, - "com.github.cleverage" % "elasticsearch_2.9.1" % "0.3" + "com.github.cleverage" % "elasticsearch_2.9.1" % "0.3.2" ) val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA).settings( From 549dae1121e1402ffba5dc5d00ccec061eff69cc Mon Sep 17 00:00:00 2001 From: Nicolas Boire Date: Wed, 3 Oct 2012 11:41:59 +0200 Subject: [PATCH 5/6] Upgrade ES to v0.19.10 -> play2-elasticsearch:0.4 --- module/project/Build.scala | 4 ++-- samples/elasticsearch-java/project/Build.scala | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/module/project/Build.scala b/module/project/Build.scala index cc96a4c..bae6df0 100644 --- a/module/project/Build.scala +++ b/module/project/Build.scala @@ -5,11 +5,11 @@ import PlayProject._ object ApplicationBuild extends Build { val appName = "elasticsearch" - val appVersion = "0.3.2" + val appVersion = "0.4" val appDependencies = Seq( // Add your project dependencies here - "org.elasticsearch" % "elasticsearch" % "0.19.9" + "org.elasticsearch" % "elasticsearch" % "0.19.10" ) val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA).settings( diff --git a/samples/elasticsearch-java/project/Build.scala b/samples/elasticsearch-java/project/Build.scala index b3546fd..b252324 100644 --- a/samples/elasticsearch-java/project/Build.scala +++ b/samples/elasticsearch-java/project/Build.scala @@ -9,7 +9,7 @@ object ApplicationBuild extends Build { val appDependencies = Seq( // Add your project dependencies here, - "com.github.cleverage" % "elasticsearch_2.9.1" % "0.3.2" + "com.github.cleverage" % "elasticsearch_2.9.1" % "0.4" ) val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA).settings( From eb01d2e73f2cb57c8886da446a351685fd869b36 Mon Sep 17 00:00:00 2001 From: Nicolas Boire Date: Wed, 3 Oct 2012 11:56:13 +0200 Subject: [PATCH 6/6] update README --- README.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9bebe80..bab2720 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,22 @@ # play2-elasticsearch =================== -This module provides [Elasticsearch](http://www.elasticsearch.org/)(v0.19.4) in a play2 application +This module provides [Elasticsearch](http://www.elasticsearch.org/)(v0.19.10) in a play2 application ## Versions 0.1 -> init version 0.2 -> Percolators support 0.3 -> IndexResult : add pagination data + 0.4 -> upgrade ES to 0.19.10 ## Roadmap - 0.4 -> Add binding for Ebean Model via an IndexModel.class + 0.5 -> Add binding for Ebean Model via an IndexModel.class ## Installing The dependency declaration is ``` -"com.github.cleverage" % "elasticsearch_2.9.1" % "0.3" +"com.github.cleverage" % "elasticsearch_2.9.1" % "0.4" ``` The resolver repository is @@ -36,7 +37,7 @@ object ApplicationBuild extends Build { val appDependencies = Seq( // Add your project dependencies here, - "com.github.cleverage" % "elasticsearch_2.9.1" % "0.3" + "com.github.cleverage" % "elasticsearch_2.9.1" % "0.4" ) val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA).settings( @@ -109,3 +110,7 @@ See samples/elasticsearch-java application for more sample ## Javadoc http://cleverage.github.com/play2-elasticsearch/javadoc/ + +## Author +@nboire & @mguillermin +