diff --git a/build.gradle b/build.gradle index 0ed1b9b2..4d3023fb 100644 --- a/build.gradle +++ b/build.gradle @@ -22,6 +22,7 @@ apply plugin: "org.grails.grails-plugin" apply plugin: "org.grails.internal.grails-plugin-publish" apply plugin: "org.grails.grails-gsp" apply plugin: "de.undercouch.download" +apply plugin: "maven-publish" sourceCompatibility = 1.8 targetCompatibility = 1.8 @@ -54,41 +55,41 @@ sourcesJar { } 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" - - provided "org.grails:grails-plugin-services" - provided "org.grails:grails-plugin-domain-class" - - compile "org.grails:grails-core" - compile "org.grails.plugins:hibernate5" - compile "org.grails.plugins:cache" - compile "org.hibernate:hibernate-ehcache" - compile "org.apache.logging.log4j:log4j-api:2.18.0" - compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.18.0' - compile "org.elasticsearch:elasticsearch:${elasticsearchVersion}" - compile group: 'org.elasticsearch.client', name: 'elasticsearch-rest-client', version: elasticsearchVersion - compile group: 'org.elasticsearch.client', name: 'elasticsearch-rest-high-level-client', version: elasticsearchVersion - compile group: 'org.locationtech.spatial4j', name: 'spatial4j', version: '0.8' + implementation 'org.springframework.boot:spring-boot-starter-logging' + implementation "org.springframework.boot:spring-boot-starter-actuator" + implementation "org.springframework.boot:spring-boot-autoconfigure" + implementation "org.springframework.boot:spring-boot-starter-tomcat" + implementation "org.grails:grails-web-boot" + implementation "org.grails:grails-dependencies" + + implementation "org.grails:grails-plugin-services" + implementation "org.grails:grails-plugin-domain-class" + + implementation "org.grails:grails-core" + implementation "org.grails.plugins:hibernate5" + implementation "org.grails.plugins:cache" + implementation "org.hibernate:hibernate-ehcache" + implementation "org.apache.logging.log4j:log4j-api:2.18.0" + implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.18.0' + implementation "org.opensearch:opensearch:${elasticsearchVersion}" + implementation group: 'org.opensearch.client', name: 'opensearch-rest-client', version: elasticsearchVersion + implementation group: 'org.opensearch.client', name: 'opensearch-rest-high-level-client', version: elasticsearchVersion + implementation group: 'org.locationtech.spatial4j', name: 'spatial4j', version: '0.8' console "org.grails:grails-console" profile "org.grails.profiles:web-plugin" - testRuntime 'com.spatial4j:spatial4j:0.5' - testRuntime 'org.apache.tomcat:tomcat-jdbc' + testRuntimeOnly 'com.spatial4j:spatial4j:0.5' + testRuntimeOnly 'org.apache.tomcat:tomcat-jdbc' - testCompile "org.grails:grails-gorm-testing-support" - testCompile "org.grails:grails-web-testing-support" + testImplementation "org.grails:grails-gorm-testing-support" + testImplementation "org.grails:grails-web-testing-support" - testCompile 'com.vividsolutions:jts:1.13' - testCompile 'com.googlecode.json-simple:json-simple:1.1.1' + testImplementation 'com.vividsolutions:jts:1.13' + testImplementation 'com.googlecode.json-simple:json-simple:1.1.1' - compile fileTree(dir: "libs/elasticsearch", include: '*.jar') + implementation fileTree(dir: "libs/elasticsearch", include: '*.jar') } task cleanLibsDir(type: Delete) { @@ -122,9 +123,9 @@ bootRun { // enable if you wish to package this plugin as a standalone application bootJar.enabled = false -apply from: "gradle/documentation.gradle" +// apply from: "gradle/documentation.gradle" -apply from: "gradle/publish.gradle" +// apply from: "gradle/publish.gradle" grailsPublish { githubSlug = 'grails-plugins/elasticsearch-grails-plugin' @@ -143,3 +144,22 @@ grailsPublish { ] } +publishing { + repositories { + maven { + name = 'ochre-libs' + url = "https://repos.ochre.io/repository/ochre-libs/" + /* + * Set these values locally in ~/.gradle/gradle.properties: + * + * ochreLibsRepoUsername=myRepoUser + * ochreLibsRepoPassword=myRepoPassword + */ + credentials { + username ochreLibsRepoUsername + password ochreLibsRepoPassword + } + } + } +} + diff --git a/gradle.properties b/gradle.properties index b4036bcf..eebc23f5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,8 +1,8 @@ -projectVersion=3.0.1-SNAPSHOT -grailsVersion=4.1.0 -grailsGradlePluginVersion=4.1.0 -gormHibernateVersion=7.0.5 -elasticsearchVersion=7.8.0 +projectVersion=4.0.0-SNAPSHOT +grailsVersion=5.1.9 +grailsGradlePluginVersion=5.1.5 +gormHibernateVersion=7.2.1 +elasticsearchVersion=1.2.4 org.gradle.caching=true org.gradle.daemon=true diff --git a/gradle/documentation.gradle b/gradle/documentation.gradle deleted file mode 100644 index 1510fdc1..00000000 --- a/gradle/documentation.gradle +++ /dev/null @@ -1,95 +0,0 @@ -buildscript { - repositories { - maven { url 'https://plugins.gradle.org/m2/'} - maven { url 'https://repo.grails.org/grails/core' } - } - dependencies { - classpath 'org.asciidoctor:asciidoctor-gradle-jvm:3.3.2' - classpath 'org.asciidoctor:asciidoctor-gradle-jvm-pdf:3.3.2' - classpath 'org.asciidoctor:asciidoctor-gradle-jvm-epub:3.3.2' - } -} - -apply plugin: 'org.asciidoctor.jvm.convert' -apply plugin: 'org.asciidoctor.jvm.pdf' -apply plugin: 'org.asciidoctor.jvm.epub' - -def asciidoctorAttributes = [ - copyright : 'Apache License, Version 2.0', - docinfo1 : 'true', - doctype : 'book', - encoding : 'utf-8', - icons : 'font', - id : project.name + ':' + project.version, - idprefix : '', - idseparator : '-', - lang : 'en', - linkattrs : true, - numbered : '', - sectlinks : true, - producer : 'Asciidoctor', - revnumber : project.version, - setanchors : true, - 'source-highlighter': 'prettify', - toc : 'left', - toc2 : '', - toclevels : '2', - grailsVersion : project.grailsVersion, - elasticsearchVersion: project.elasticsearchVersion -] - -import org.asciidoctor.gradle.jvm.AsciidoctorTask - -asciidoctor { - attributes asciidoctorAttributes - outputDir new File(buildDir, 'docs/manual') - sourceDir = file('src/docs') - sources { - include 'index.adoc' - include 'ref/index.adoc' - } -} - -tasks.withType(AsciidoctorTask) { - configure { - baseDirIsProjectDir() - outputOptions { - separateOutputDirs = false - backends = ['html5', 'pdf'] - } - } -} - -tasks.register("docs") { - dependsOn = ["asciidoctor"] - group = "documentation" - doLast { - File dir = new File(buildDir, 'docs/manual') - ['pdf'].each { String ext -> - File f = new File(dir, 'index.' + ext) - if (f.exists()) { - f.renameTo new File(dir, project.name + '-' + project.version + '.' + ext) - } - } - - File quickRefDir = new File(buildDir, 'docs/manual/ref') - ['pdf'].each { String ext -> - File f = new File(quickRefDir, 'index.' + ext) - if (f.exists()) { - f.renameTo new File(quickRefDir, project.name + '-' + project.version + '-' + 'quickReference' + '.' + ext) - } - } - - File ghpages = new File(buildDir, 'docs/index.html') - if (ghpages.exists()) { - ghpages.delete() - } - ghpages << file('src/docs/index.tmpl').text.replaceAll('@VERSION@', project.version) - - copy { - from 'src/docs' - into new File(buildDir, 'docs/manual').path - include '**/*.png' - } - } -} \ No newline at end of file diff --git a/gradle/publish.gradle b/gradle/publish.gradle deleted file mode 100644 index 3ae6b9ba..00000000 --- a/gradle/publish.gradle +++ /dev/null @@ -1,21 +0,0 @@ -// Publish gh-pages on github -apply plugin: "org.ajoberstar.github-pages" - -ext { - githubApiKey = System.getProperty('githubApiKey') -} - -githubPages { - repoUri = 'https://github.com/puneetbehl/elasticsearch-grails-plugin.git' - - credentials { - username = project.hasProperty('githubApiKey') ? project.githubApiKey : '' - password = '' - } - - pages { - from "${buildDir}/docs" - } -} - -task publishDocs(dependsOn: [docs, publishGhPages]) \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 5c2d1cf0..e708b1c0 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 5028f28f..ffed3a25 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 83f2acfd..4f906e0c 100755 --- a/gradlew +++ b/gradlew @@ -82,6 +82,7 @@ esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then @@ -129,6 +130,7 @@ fi if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` # We build the pattern for arguments to be converted via cygpath @@ -154,19 +156,19 @@ if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then else eval `echo args$i`="\"$arg\"" fi - i=$((i+1)) + i=`expr $i + 1` done case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; esac fi @@ -175,14 +177,9 @@ save () { for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done echo " " } -APP_ARGS=$(save "$@") +APP_ARGS=`save "$@"` # Collect all arguments for the java command, following the shell quoting and substitution rules eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" -fi - exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index 9618d8d9..107acd32 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @@ -37,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if "%ERRORLEVEL%" == "0" goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -51,7 +54,7 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% @@ -61,28 +64,14 @@ echo location of your Java installation. goto fail -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - :execute @rem Setup the command line set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell diff --git a/grails-app/conf/logback.groovy b/grails-app/conf/logback.groovy deleted file mode 100644 index 99874fbb..00000000 --- a/grails-app/conf/logback.groovy +++ /dev/null @@ -1,30 +0,0 @@ -import grails.util.BuildSettings -import grails.util.Environment - -// See http://logback.qos.ch/manual/groovy.html for details on configuration -appender('STDOUT', ConsoleAppender) { - encoder(PatternLayoutEncoder) { - pattern = "%level %logger - %msg%n" - } -} - -root(ERROR, ['STDOUT']) - -def targetDir = BuildSettings.TARGET_DIR -if (Environment.isDevelopmentMode() && targetDir) { - appender("FULL_STACKTRACE", FileAppender) { - file = "${targetDir}/stacktrace.log" - append = true - encoder(PatternLayoutEncoder) { - pattern = "%level %logger - %msg%n" - } - } - logger("StackTrace", ERROR, ['FULL_STACKTRACE'], false) -} - -//logger("grails.plugins.elasticsearch", DEBUG, ['STDOUT'], false) -//logger("org.codehaus.groovy.grails", ERROR, ['STDOUT'], false) -//logger("org.springframework", ERROR, ['STDOUT'], false) -//logger("org.hibernate", ERROR, ['STDOUT'], false) -//logger("net.sf.ehcache.hibernate", ERROR, ['STDOUT'], false) - diff --git a/grails-app/conf/logback.xml b/grails-app/conf/logback.xml new file mode 100644 index 00000000..663389a0 --- /dev/null +++ b/grails-app/conf/logback.xml @@ -0,0 +1,17 @@ + + + + + + + + + UTF-8 + %clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wex + + + + + + + \ No newline at end of file diff --git a/grails-app/services/grails/plugins/elasticsearch/ElasticSearchAdminService.groovy b/grails-app/services/grails/plugins/elasticsearch/ElasticSearchAdminService.groovy index 34e9c050..dc227f81 100644 --- a/grails-app/services/grails/plugins/elasticsearch/ElasticSearchAdminService.groovy +++ b/grails-app/services/grails/plugins/elasticsearch/ElasticSearchAdminService.groovy @@ -4,26 +4,26 @@ import grails.plugins.elasticsearch.index.IndexRequestQueue import grails.plugins.elasticsearch.mapping.SearchableClassMapping import groovy.json.JsonSlurper import org.apache.http.util.EntityUtils -import org.elasticsearch.action.admin.cluster.health.ClusterHealthRequest -import org.elasticsearch.action.admin.cluster.health.ClusterHealthRequestBuilder -import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse -import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest -import org.elasticsearch.action.admin.indices.alias.get.GetAliasesRequest -import org.elasticsearch.action.admin.indices.create.CreateIndexRequest -import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest -import org.elasticsearch.action.admin.indices.get.GetIndexRequest -import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsRequest -import org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequest -import org.elasticsearch.action.admin.indices.refresh.RefreshRequest -import org.elasticsearch.action.support.broadcast.BroadcastResponse -import org.elasticsearch.client.* -import org.elasticsearch.cluster.health.ClusterHealthStatus -import org.elasticsearch.common.settings.Settings -import org.elasticsearch.common.xcontent.XContentHelper -import org.elasticsearch.common.xcontent.XContentType -import org.elasticsearch.index.query.MatchAllQueryBuilder -import org.elasticsearch.index.reindex.DeleteByQueryRequest -import org.elasticsearch.rest.RestStatus +import org.opensearch.action.admin.cluster.health.ClusterHealthRequest +import org.opensearch.action.admin.cluster.health.ClusterHealthRequestBuilder +import org.opensearch.action.admin.cluster.health.ClusterHealthResponse +import org.opensearch.action.admin.indices.alias.IndicesAliasesRequest +import org.opensearch.action.admin.indices.alias.get.GetAliasesRequest +import org.opensearch.action.admin.indices.create.CreateIndexRequest +import org.opensearch.action.admin.indices.delete.DeleteIndexRequest +import org.opensearch.action.admin.indices.get.GetIndexRequest +import org.opensearch.action.admin.indices.mapping.get.GetMappingsRequest +import org.opensearch.action.admin.indices.mapping.put.PutMappingRequest +import org.opensearch.action.admin.indices.refresh.RefreshRequest +import org.opensearch.action.support.broadcast.BroadcastResponse +import org.opensearch.client.* +import org.opensearch.cluster.health.ClusterHealthStatus +import org.opensearch.common.settings.Settings +import org.opensearch.common.xcontent.XContentHelper +import org.opensearch.common.xcontent.XContentType +import org.opensearch.index.query.MatchAllQueryBuilder +import org.opensearch.index.reindex.DeleteByQueryRequest +import org.opensearch.rest.RestStatus import org.slf4j.Logger import org.slf4j.LoggerFactory diff --git a/grails-app/services/grails/plugins/elasticsearch/ElasticSearchService.groovy b/grails-app/services/grails/plugins/elasticsearch/ElasticSearchService.groovy index 77f2592e..09e116be 100755 --- a/grails-app/services/grails/plugins/elasticsearch/ElasticSearchService.groovy +++ b/grails-app/services/grails/plugins/elasticsearch/ElasticSearchService.groovy @@ -22,36 +22,36 @@ import grails.plugins.elasticsearch.index.IndexRequestQueue import grails.plugins.elasticsearch.mapping.SearchableClassMapping import grails.plugins.elasticsearch.util.GXContentBuilder import groovy.util.logging.Slf4j -import org.elasticsearch.action.search.SearchRequest -import org.elasticsearch.action.search.SearchResponse -import org.elasticsearch.client.RequestOptions -import org.elasticsearch.client.RestHighLevelClient -import org.elasticsearch.common.settings.Settings -import org.elasticsearch.common.xcontent.DeprecationHandler -import org.elasticsearch.common.xcontent.NamedXContentRegistry -import org.elasticsearch.common.xcontent.XContent -import org.elasticsearch.common.xcontent.XContentLocation -import org.elasticsearch.common.xcontent.XContentParser -import org.elasticsearch.common.xcontent.json.JsonXContent -import org.elasticsearch.index.query.Operator -import org.elasticsearch.index.query.QueryBuilder -import org.elasticsearch.index.query.QueryStringQueryBuilder -import org.elasticsearch.search.SearchHit -import org.elasticsearch.search.SearchHits -import org.elasticsearch.search.SearchModule -import org.elasticsearch.search.aggregations.Aggregation -import org.elasticsearch.search.aggregations.Aggregations -import org.elasticsearch.search.aggregations.AggregatorFactories -import org.elasticsearch.search.aggregations.BaseAggregationBuilder -import org.elasticsearch.search.builder.SearchSourceBuilder -import org.elasticsearch.search.fetch.subphase.highlight.HighlightBuilder -import org.elasticsearch.search.sort.SortBuilder -import org.elasticsearch.search.sort.SortOrder +import org.opensearch.action.search.SearchRequest +import org.opensearch.action.search.SearchResponse +import org.opensearch.client.RequestOptions +import org.opensearch.client.RestHighLevelClient +import org.opensearch.common.settings.Settings +import org.opensearch.common.xcontent.DeprecationHandler +import org.opensearch.common.xcontent.NamedXContentRegistry +import org.opensearch.common.xcontent.XContent +import org.opensearch.common.xcontent.XContentLocation +import org.opensearch.common.xcontent.XContentParser +import org.opensearch.common.xcontent.json.JsonXContent +import org.opensearch.index.query.Operator +import org.opensearch.index.query.QueryBuilder +import org.opensearch.index.query.QueryStringQueryBuilder +import org.opensearch.search.SearchHit +import org.opensearch.search.SearchHits +import org.opensearch.search.SearchModule +import org.opensearch.search.aggregations.Aggregation +import org.opensearch.search.aggregations.Aggregations +import org.opensearch.search.aggregations.AggregatorFactories +import org.opensearch.search.aggregations.BaseAggregationBuilder +import org.opensearch.search.builder.SearchSourceBuilder +import org.opensearch.search.fetch.subphase.highlight.HighlightBuilder +import org.opensearch.search.sort.SortBuilder +import org.opensearch.search.sort.SortOrder import java.util.function.Supplier import static grails.plugins.elasticsearch.util.AbstractQueryBuilderParser.parseInnerQueryBuilder -import static org.elasticsearch.index.query.QueryBuilders.queryStringQuery +import static org.opensearch.index.query.QueryBuilders.queryStringQuery @Slf4j class ElasticSearchService implements GrailsApplicationAware { diff --git a/src/integration-test/groovy/grails/plugins/elasticsearch/AnalyzersIntegrationSpec.groovy b/src/integration-test/groovy/grails/plugins/elasticsearch/AnalyzersIntegrationSpec.groovy index 5e0b73da..896f6acc 100644 --- a/src/integration-test/groovy/grails/plugins/elasticsearch/AnalyzersIntegrationSpec.groovy +++ b/src/integration-test/groovy/grails/plugins/elasticsearch/AnalyzersIntegrationSpec.groovy @@ -5,7 +5,7 @@ import spock.lang.Specification import grails.testing.mixin.integration.Integration import grails.gorm.transactions.Rollback -import org.elasticsearch.index.query.QueryBuilders +import org.opensearch.index.query.QueryBuilders import test.all.Post /** diff --git a/src/integration-test/groovy/grails/plugins/elasticsearch/DynamicMethodsIntegrationSpec.groovy b/src/integration-test/groovy/grails/plugins/elasticsearch/DynamicMethodsIntegrationSpec.groovy index e61a0a11..e426fc9a 100644 --- a/src/integration-test/groovy/grails/plugins/elasticsearch/DynamicMethodsIntegrationSpec.groovy +++ b/src/integration-test/groovy/grails/plugins/elasticsearch/DynamicMethodsIntegrationSpec.groovy @@ -2,12 +2,12 @@ package grails.plugins.elasticsearch import grails.gorm.transactions.Rollback import grails.testing.mixin.integration.Integration -import org.elasticsearch.index.query.Operator -import org.elasticsearch.index.query.QueryBuilder -import org.elasticsearch.index.query.QueryBuilders -import org.elasticsearch.search.aggregations.AggregationBuilder -import org.elasticsearch.search.aggregations.AggregationBuilders -import org.elasticsearch.search.aggregations.bucket.filter.FiltersAggregator +import org.opensearch.index.query.Operator +import org.opensearch.index.query.QueryBuilder +import org.opensearch.index.query.QueryBuilders +import org.opensearch.search.aggregations.AggregationBuilder +import org.opensearch.search.aggregations.AggregationBuilders +import org.opensearch.search.aggregations.bucket.filter.FiltersAggregator import spock.lang.Specification import test.Photo diff --git a/src/integration-test/groovy/grails/plugins/elasticsearch/ElasticSearchServiceIntegrationSpec.groovy b/src/integration-test/groovy/grails/plugins/elasticsearch/ElasticSearchServiceIntegrationSpec.groovy index 6248d4e1..bbf7df27 100644 --- a/src/integration-test/groovy/grails/plugins/elasticsearch/ElasticSearchServiceIntegrationSpec.groovy +++ b/src/integration-test/groovy/grails/plugins/elasticsearch/ElasticSearchServiceIntegrationSpec.groovy @@ -4,17 +4,17 @@ import grails.converters.JSON import grails.gorm.transactions.NotTransactional import grails.gorm.transactions.Rollback import grails.testing.mixin.integration.Integration -import org.elasticsearch.action.get.GetRequest -import org.elasticsearch.action.get.GetResponse -import org.elasticsearch.client.RequestOptions -import org.elasticsearch.common.unit.DistanceUnit -import org.elasticsearch.index.query.QueryBuilder -import org.elasticsearch.index.query.QueryBuilders -import org.elasticsearch.join.query.JoinQueryBuilders -import org.elasticsearch.search.aggregations.AggregationBuilders -import org.elasticsearch.search.sort.FieldSortBuilder -import org.elasticsearch.search.sort.SortBuilders -import org.elasticsearch.search.sort.SortOrder +import org.opensearch.action.get.GetRequest +import org.opensearch.action.get.GetResponse +import org.opensearch.client.RequestOptions +import org.opensearch.common.unit.DistanceUnit +import org.opensearch.index.query.QueryBuilder +import org.opensearch.index.query.QueryBuilders +import org.opensearch.join.query.JoinQueryBuilders +import org.opensearch.search.aggregations.AggregationBuilders +import org.opensearch.search.sort.FieldSortBuilder +import org.opensearch.search.sort.SortBuilders +import org.opensearch.search.sort.SortOrder import org.grails.web.json.JSONObject import org.hibernate.proxy.HibernateProxy import spock.lang.Ignore diff --git a/src/integration-test/groovy/grails/plugins/elasticsearch/ElasticSearchSpec.groovy b/src/integration-test/groovy/grails/plugins/elasticsearch/ElasticSearchSpec.groovy index 2a442637..9db471cc 100644 --- a/src/integration-test/groovy/grails/plugins/elasticsearch/ElasticSearchSpec.groovy +++ b/src/integration-test/groovy/grails/plugins/elasticsearch/ElasticSearchSpec.groovy @@ -4,14 +4,14 @@ import grails.core.GrailsApplication import grails.plugins.elasticsearch.mapping.DomainEntity import grails.plugins.elasticsearch.mapping.SearchableClassMappingConfigurator import grails.util.GrailsNameUtils -import org.elasticsearch.action.search.SearchRequest -import org.elasticsearch.client.RequestOptions -import org.elasticsearch.client.RestHighLevelClient -import org.elasticsearch.client.indices.GetIndexRequest -import org.elasticsearch.client.indices.GetIndexResponse -import org.elasticsearch.cluster.metadata.MappingMetadata -import org.elasticsearch.common.collect.ImmutableOpenMap -import org.elasticsearch.index.query.QueryBuilder +import org.opensearch.action.search.SearchRequest +import org.opensearch.client.RequestOptions +import org.opensearch.client.RestHighLevelClient +import org.opensearch.client.indices.GetIndexRequest +import org.opensearch.client.indices.GetIndexResponse +import org.opensearch.cluster.metadata.MappingMetadata +import org.opensearch.common.collect.ImmutableOpenMap +import org.opensearch.index.query.QueryBuilder import org.grails.datastore.gorm.GormEntity import org.hibernate.SessionFactory import org.springframework.beans.factory.annotation.Autowired diff --git a/src/integration-test/groovy/grails/plugins/elasticsearch/conversion/unmarshall/DomainClassUnmarshallerIntegrationSpec.groovy b/src/integration-test/groovy/grails/plugins/elasticsearch/conversion/unmarshall/DomainClassUnmarshallerIntegrationSpec.groovy index abbea894..0e61f707 100644 --- a/src/integration-test/groovy/grails/plugins/elasticsearch/conversion/unmarshall/DomainClassUnmarshallerIntegrationSpec.groovy +++ b/src/integration-test/groovy/grails/plugins/elasticsearch/conversion/unmarshall/DomainClassUnmarshallerIntegrationSpec.groovy @@ -7,10 +7,10 @@ import grails.plugins.elasticsearch.ElasticSearchSpec import grails.plugins.elasticsearch.exception.MappingException import grails.testing.mixin.integration.Integration import org.apache.lucene.search.TotalHits -import org.elasticsearch.common.bytes.BytesArray -import org.elasticsearch.common.text.Text -import org.elasticsearch.search.SearchHit -import org.elasticsearch.search.SearchHits +import org.opensearch.common.bytes.BytesArray +import org.opensearch.common.text.Text +import org.opensearch.search.SearchHit +import org.opensearch.search.SearchHits import org.slf4j.Logger import spock.lang.Specification import test.GeoPoint diff --git a/src/integration-test/groovy/grails/plugins/elasticsearch/transients/TransientPropertiesIntegrationSpec.groovy b/src/integration-test/groovy/grails/plugins/elasticsearch/transients/TransientPropertiesIntegrationSpec.groovy index 4dbbe34e..a20f049b 100644 --- a/src/integration-test/groovy/grails/plugins/elasticsearch/transients/TransientPropertiesIntegrationSpec.groovy +++ b/src/integration-test/groovy/grails/plugins/elasticsearch/transients/TransientPropertiesIntegrationSpec.groovy @@ -7,8 +7,8 @@ import grails.plugins.elasticsearch.ElasticSearchService import grails.plugins.elasticsearch.mapping.SearchableClassMappingConfigurator import grails.testing.mixin.integration.Integration import org.apache.lucene.search.join.ScoreMode -import org.elasticsearch.index.query.NestedQueryBuilder -import org.elasticsearch.index.query.QueryBuilders +import org.opensearch.index.query.NestedQueryBuilder +import org.opensearch.index.query.QueryBuilders import org.springframework.beans.factory.annotation.Autowired import spock.lang.Specification import test.transients.* diff --git a/src/main/groovy/grails/plugins/elasticsearch/ClientNodeFactoryBean.groovy b/src/main/groovy/grails/plugins/elasticsearch/ClientNodeFactoryBean.groovy index bf92c623..96304f43 100644 --- a/src/main/groovy/grails/plugins/elasticsearch/ClientNodeFactoryBean.groovy +++ b/src/main/groovy/grails/plugins/elasticsearch/ClientNodeFactoryBean.groovy @@ -23,10 +23,10 @@ import org.apache.http.client.CredentialsProvider import org.apache.http.client.config.RequestConfig import org.apache.http.impl.client.BasicCredentialsProvider import org.apache.http.impl.nio.client.HttpAsyncClientBuilder -import org.elasticsearch.client.Client -import org.elasticsearch.client.RestClient -import org.elasticsearch.client.RestClientBuilder -import org.elasticsearch.client.RestHighLevelClient +import org.opensearch.client.Client +import org.opensearch.client.RestClient +import org.opensearch.client.RestClientBuilder +import org.opensearch.client.RestHighLevelClient import org.slf4j.Logger import org.slf4j.LoggerFactory import org.springframework.beans.factory.FactoryBean diff --git a/src/main/groovy/grails/plugins/elasticsearch/ConnectionString.groovy b/src/main/groovy/grails/plugins/elasticsearch/ConnectionString.groovy index 7f6d1301..871bf052 100644 --- a/src/main/groovy/grails/plugins/elasticsearch/ConnectionString.groovy +++ b/src/main/groovy/grails/plugins/elasticsearch/ConnectionString.groovy @@ -1,7 +1,7 @@ package grails.plugins.elasticsearch import groovy.util.logging.Slf4j -import org.elasticsearch.ElasticsearchException +import org.opensearch.OpenSearchException import static java.lang.String.format import static java.util.Arrays.asList @@ -98,7 +98,7 @@ class ConnectionString { try { portToUse = Integer.parseInt(hostToUse.substring(idx + 1)) } catch (NumberFormatException e) { - throw new ElasticsearchException("host and port should be specified in host:port format") + throw new OpenSearchException("host and port should be specified in host:port format") } hostToUse = hostToUse.substring(0, idx).trim() } diff --git a/src/main/groovy/grails/plugins/elasticsearch/ElasticSearchHelper.groovy b/src/main/groovy/grails/plugins/elasticsearch/ElasticSearchHelper.groovy index b2045fa8..8ec09d90 100644 --- a/src/main/groovy/grails/plugins/elasticsearch/ElasticSearchHelper.groovy +++ b/src/main/groovy/grails/plugins/elasticsearch/ElasticSearchHelper.groovy @@ -2,13 +2,13 @@ package grails.plugins.elasticsearch import groovy.transform.stc.ClosureParams import groovy.transform.stc.SimpleType -import org.elasticsearch.client.RestHighLevelClient +import org.opensearch.client.RestHighLevelClient class ElasticSearchHelper { RestHighLevelClient elasticSearchClient - def R withElasticSearch(@ClosureParams(value=SimpleType, options="org.elasticsearch.client.RestHighLevelClient") Closure callable) { + def R withElasticSearch(@ClosureParams(value=SimpleType, options="org.opensearch.client.RestHighLevelClient") Closure callable) { callable.call(elasticSearchClient) } diff --git a/src/main/groovy/grails/plugins/elasticsearch/ElasticSearchResult.groovy b/src/main/groovy/grails/plugins/elasticsearch/ElasticSearchResult.groovy index a3049c2e..b900d081 100644 --- a/src/main/groovy/grails/plugins/elasticsearch/ElasticSearchResult.groovy +++ b/src/main/groovy/grails/plugins/elasticsearch/ElasticSearchResult.groovy @@ -2,8 +2,8 @@ package grails.plugins.elasticsearch import groovy.transform.CompileStatic import org.apache.lucene.search.TotalHits -import org.elasticsearch.search.aggregations.Aggregation -import org.elasticsearch.search.fetch.subphase.highlight.HighlightField +import org.opensearch.search.aggregations.Aggregation +import org.opensearch.search.fetch.subphase.highlight.HighlightField @CompileStatic class ElasticSearchResult { diff --git a/src/main/groovy/grails/plugins/elasticsearch/conversion/JSONDomainFactory.groovy b/src/main/groovy/grails/plugins/elasticsearch/conversion/JSONDomainFactory.groovy index e536c0be..5c1e9881 100644 --- a/src/main/groovy/grails/plugins/elasticsearch/conversion/JSONDomainFactory.groovy +++ b/src/main/groovy/grails/plugins/elasticsearch/conversion/JSONDomainFactory.groovy @@ -23,12 +23,12 @@ import grails.plugins.elasticsearch.mapping.DomainEntity import grails.plugins.elasticsearch.mapping.DomainReflectionService import grails.plugins.elasticsearch.mapping.SearchableClassMapping import grails.plugins.elasticsearch.unwrap.DomainClassUnWrapperChain -import org.elasticsearch.common.xcontent.XContentBuilder +import org.opensearch.common.xcontent.XContentBuilder import java.beans.PropertyEditor import java.sql.Timestamp -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder +import static org.opensearch.common.xcontent.XContentFactory.jsonBuilder /** * Marshall objects as JSON. diff --git a/src/main/groovy/grails/plugins/elasticsearch/conversion/unmarshall/DomainClassUnmarshaller.groovy b/src/main/groovy/grails/plugins/elasticsearch/conversion/unmarshall/DomainClassUnmarshaller.groovy index 28abb222..ff4e0b20 100644 --- a/src/main/groovy/grails/plugins/elasticsearch/conversion/unmarshall/DomainClassUnmarshaller.groovy +++ b/src/main/groovy/grails/plugins/elasticsearch/conversion/unmarshall/DomainClassUnmarshaller.groovy @@ -31,12 +31,12 @@ import java.time.OffsetTime import java.time.temporal.Temporal import java.time.format.DateTimeFormatter as JDateTimeFormatter import org.codehaus.groovy.runtime.DefaultGroovyMethods -import org.elasticsearch.action.get.GetRequest -import org.elasticsearch.action.get.GetResponse -import org.elasticsearch.client.RequestOptions -import org.elasticsearch.client.RestHighLevelClient -import org.elasticsearch.search.SearchHit -import org.elasticsearch.search.SearchHits +import org.opensearch.action.get.GetRequest +import org.opensearch.action.get.GetResponse +import org.opensearch.client.RequestOptions +import org.opensearch.client.RestHighLevelClient +import org.opensearch.search.SearchHit +import org.opensearch.search.SearchHits import org.joda.time.DateTime import org.joda.time.DateTimeZone import org.joda.time.format.DateTimeFormat diff --git a/src/main/groovy/grails/plugins/elasticsearch/index/IndexRequestQueue.groovy b/src/main/groovy/grails/plugins/elasticsearch/index/IndexRequestQueue.groovy index c0a22912..2d479782 100755 --- a/src/main/groovy/grails/plugins/elasticsearch/index/IndexRequestQueue.groovy +++ b/src/main/groovy/grails/plugins/elasticsearch/index/IndexRequestQueue.groovy @@ -21,16 +21,16 @@ import grails.plugins.elasticsearch.exception.IndexException import grails.plugins.elasticsearch.mapping.SearchableClassMapping import grails.plugins.elasticsearch.unwrap.DomainClassUnWrapperChain import org.codehaus.groovy.runtime.InvokerHelper -import org.elasticsearch.action.ActionListener -import org.elasticsearch.action.bulk.* -import org.elasticsearch.action.delete.DeleteRequest -import org.elasticsearch.action.index.IndexRequest -import org.elasticsearch.client.RequestOptions -import org.elasticsearch.client.RestHighLevelClient -import org.elasticsearch.common.unit.ByteSizeUnit -import org.elasticsearch.common.unit.ByteSizeValue -import org.elasticsearch.common.unit.TimeValue -import org.elasticsearch.common.xcontent.XContentBuilder +import org.opensearch.action.ActionListener +import org.opensearch.action.bulk.* +import org.opensearch.action.delete.DeleteRequest +import org.opensearch.action.index.IndexRequest +import org.opensearch.client.RequestOptions +import org.opensearch.client.RestHighLevelClient +import org.opensearch.common.unit.ByteSizeUnit +import org.opensearch.common.unit.ByteSizeValue +import org.opensearch.common.unit.TimeValue +import org.opensearch.common.xcontent.XContentBuilder import org.slf4j.Logger import org.slf4j.LoggerFactory import org.springframework.util.Assert diff --git a/src/main/groovy/grails/plugins/elasticsearch/mapping/SearchableClassMapping.groovy b/src/main/groovy/grails/plugins/elasticsearch/mapping/SearchableClassMapping.groovy index d31d008f..238a9e1f 100644 --- a/src/main/groovy/grails/plugins/elasticsearch/mapping/SearchableClassMapping.groovy +++ b/src/main/groovy/grails/plugins/elasticsearch/mapping/SearchableClassMapping.groovy @@ -95,7 +95,7 @@ class SearchableClassMapping implements ElasticSearchConfigAware { name = prefix + "."+name } - // index name must be lowercase (org.elasticsearch.indices.InvalidIndexNameException) + // index name must be lowercase (org.opensearch.indices.InvalidIndexNameException) name.toLowerCase() } diff --git a/src/main/groovy/grails/plugins/elasticsearch/mapping/SearchableClassMappingConfigurator.groovy b/src/main/groovy/grails/plugins/elasticsearch/mapping/SearchableClassMappingConfigurator.groovy index 4d576ab6..037df6ed 100644 --- a/src/main/groovy/grails/plugins/elasticsearch/mapping/SearchableClassMappingConfigurator.groovy +++ b/src/main/groovy/grails/plugins/elasticsearch/mapping/SearchableClassMappingConfigurator.groovy @@ -21,10 +21,10 @@ import grails.plugins.elasticsearch.ElasticSearchAdminService import grails.plugins.elasticsearch.ElasticSearchContextHolder import grails.plugins.elasticsearch.util.ElasticSearchConfigAware import groovy.transform.CompileStatic -import org.elasticsearch.ElasticsearchStatusException -import org.elasticsearch.cluster.health.ClusterHealthStatus -import org.elasticsearch.indices.InvalidIndexTemplateException -import org.elasticsearch.transport.RemoteTransportException +import org.opensearch.OpenSearchStatusException +import org.opensearch.cluster.health.ClusterHealthStatus +import org.opensearch.indices.InvalidIndexTemplateException +import org.opensearch.transport.RemoteTransportException import org.slf4j.Logger import org.slf4j.LoggerFactory @@ -148,7 +148,7 @@ class SearchableClassMappingConfigurator implements ElasticSearchConfigAware { } catch (InvalidIndexTemplateException e) { LOG.warn("Could not install mapping ${scm.indexName}/${scm.elasticTypeName} due to ${e.message}, migrations needed") mappingConflicts << new MappingConflict(scm: scm, exception: e) - } catch (ElasticsearchStatusException e) { + } catch (OpenSearchStatusException e) { LOG.warn("Could not install mapping ${scm.indexName}/${scm.elasticTypeName} due to ${e.message}, migrations needed") mappingConflicts << new MappingConflict(scm: scm, exception: e) } catch (IOException e) { diff --git a/src/main/groovy/grails/plugins/elasticsearch/util/AbstractQueryBuilderParser.groovy b/src/main/groovy/grails/plugins/elasticsearch/util/AbstractQueryBuilderParser.groovy index 0b675a84..369aaa0b 100644 --- a/src/main/groovy/grails/plugins/elasticsearch/util/AbstractQueryBuilderParser.groovy +++ b/src/main/groovy/grails/plugins/elasticsearch/util/AbstractQueryBuilderParser.groovy @@ -1,11 +1,11 @@ package grails.plugins.elasticsearch.util import groovy.transform.CompileStatic -import org.elasticsearch.common.ParsingException -import org.elasticsearch.common.xcontent.NamedObjectNotFoundException -import org.elasticsearch.common.xcontent.XContentLocation -import org.elasticsearch.common.xcontent.XContentParser -import org.elasticsearch.index.query.QueryBuilder +import org.opensearch.common.ParsingException +import org.opensearch.common.xcontent.NamedObjectNotFoundException +import org.opensearch.common.xcontent.XContentLocation +import org.opensearch.common.xcontent.XContentParser +import org.opensearch.index.query.QueryBuilder /** * Created by ehauske on 2/08/17. diff --git a/src/main/groovy/grails/plugins/elasticsearch/util/DomainDynamicMethodsUtils.groovy b/src/main/groovy/grails/plugins/elasticsearch/util/DomainDynamicMethodsUtils.groovy index 052a049f..166830b3 100644 --- a/src/main/groovy/grails/plugins/elasticsearch/util/DomainDynamicMethodsUtils.groovy +++ b/src/main/groovy/grails/plugins/elasticsearch/util/DomainDynamicMethodsUtils.groovy @@ -23,9 +23,9 @@ import grails.plugins.elasticsearch.mapping.DomainEntity import grails.plugins.elasticsearch.mapping.DomainReflectionService import grails.plugins.elasticsearch.mapping.SearchableClassMapping import org.apache.commons.logging.LogFactory -import org.elasticsearch.index.query.QueryBuilder -import org.elasticsearch.search.aggregations.AggregationBuilder -import org.elasticsearch.search.aggregations.BaseAggregationBuilder +import org.opensearch.index.query.QueryBuilder +import org.opensearch.search.aggregations.AggregationBuilder +import org.opensearch.search.aggregations.BaseAggregationBuilder import org.springframework.context.ApplicationContext class DomainDynamicMethodsUtils { diff --git a/src/main/groovy/grails/plugins/elasticsearch/util/GXContentBuilder.groovy b/src/main/groovy/grails/plugins/elasticsearch/util/GXContentBuilder.groovy index 6490e563..68dcf265 100644 --- a/src/main/groovy/grails/plugins/elasticsearch/util/GXContentBuilder.groovy +++ b/src/main/groovy/grails/plugins/elasticsearch/util/GXContentBuilder.groovy @@ -19,10 +19,10 @@ package grails.plugins.elasticsearch.util -import org.elasticsearch.common.bytes.BytesReference -import org.elasticsearch.common.xcontent.XContentBuilder -import org.elasticsearch.common.xcontent.XContentFactory -import org.elasticsearch.common.xcontent.XContentType +import org.opensearch.common.bytes.BytesReference +import org.opensearch.common.xcontent.XContentBuilder +import org.opensearch.common.xcontent.XContentFactory +import org.opensearch.common.xcontent.XContentType /** * This is a hacked version of EC's GXContentBuilder with patched property delegation.