Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,10 @@ Download the self-contained fat JAR for your Elasticsearch version:

| Elasticsearch Version | Artifact |
|-----------------------|----------------------------------------|
| ES 6.x | `softclient4es6-jdbc-driver-0.1.1.jar` |
| ES 7.x | `softclient4es7-jdbc-driver-0.1.1.jar` |
| ES 8.x | `softclient4es8-jdbc-driver-0.1.1.jar` |
| ES 9.x | `softclient4es9-jdbc-driver-0.1.1.jar` |
| ES 6.x | `softclient4es6-jdbc-driver-0.1.3.jar` |
| ES 7.x | `softclient4es7-jdbc-driver-0.1.3.jar` |
| ES 8.x | `softclient4es8-jdbc-driver-0.1.3.jar` |
| ES 9.x | `softclient4es9-jdbc-driver-0.1.3.jar` |

```text
JDBC URL: jdbc:elastic://localhost:9200
Expand All @@ -190,20 +190,20 @@ Driver class: app.softnetwork.elastic.jdbc.ElasticDriver
<dependency>
<groupId>app.softnetwork.elastic</groupId>
<artifactId>softclient4es8-jdbc-driver</artifactId>
<version>0.1.1</version>
<version>0.1.3</version>
</dependency>
```

**Gradle:**

```groovy
implementation 'app.softnetwork.elastic:softclient4es8-jdbc-driver:0.1.1'
implementation 'app.softnetwork.elastic:softclient4es8-jdbc-driver:0.1.3'
```

**sbt:**

```scala
libraryDependencies += "app.softnetwork.elastic" % "softclient4es8-jdbc-driver" % "0.1.1"
libraryDependencies += "app.softnetwork.elastic" % "softclient4es8-jdbc-driver" % "0.1.3"
```

The JDBC driver JARs are Scala-version-independent (no `_2.12` or `_2.13` suffix) and include all required dependencies.
Expand Down Expand Up @@ -231,11 +231,11 @@ For programmatic access, add SoftClient4ES to your project.
resolvers += "Softnetwork" at "https://softnetwork.jfrog.io/artifactory/releases/"

// Choose your Elasticsearch version
libraryDependencies += "app.softnetwork.elastic" %% "softclient4es8-java-client" % "0.18.0"
libraryDependencies += "app.softnetwork.elastic" %% "softclient4es8-java-client" % "0.19.0"
// Add the community extensions for materialized views (optional)
libraryDependencies += "app.softnetwork.elastic" %% "softclient4es-community-extensions" % "0.1.1"
libraryDependencies += "app.softnetwork.elastic" %% "softclient4es-community-extensions" % "0.1.3"
// Add the JDBC driver if you want to use it from Scala (optional)
libraryDependencies += "app.softnetwork.elastic" %% "softclient4es-jdbc-driver" % "0.1.1"
libraryDependencies += "app.softnetwork.elastic" %% "softclient4es-jdbc-driver" % "0.1.3"
```

```scala
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ object ElasticAggregation {
bucketsDirection
.get(identifier.identifierName)
.orElse(bucketsDirection.get(identifier.aliasOrName))
.orElse(fieldAlias.flatMap(a => bucketsDirection.get(a.alias)))

val field = fieldAlias match {
case Some(alias) => alias.alias
Expand All @@ -131,15 +132,16 @@ object ElasticAggregation {
val aggName = {
if (fieldAlias.isDefined)
field
else if (distinct)
s"${aggType}_distinct_${sourceField.replace(".", "_")}"
else {
aggType match {
case COUNT if sourceField == "*" =>
if (distinct) "count_distinct_all" else "count_all"
case _ if distinct =>
s"${aggType}_distinct_${sourceField.replace(".", "_")}"
case th: WindowFunction =>
s"${th.window.sql.toLowerCase}_${sourceField.replace(".", "_")}"
case _ =>
s"${aggType}_${sourceField.replace(".", "_")}"

}
}
}
Expand Down
Loading
Loading