Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
e62b255
init support for dml and ddl statements
fupelaqu Dec 8, 2025
e3b0b6f
Merge branch 'main' into feature/sqlDMLAndDDL
fupelaqu Dec 9, 2025
a00f5f4
add support for ALTER COLUMN SET FIELDS, update documentation
fupelaqu Dec 10, 2025
7c24b89
update documentation
fupelaqu Dec 10, 2025
da6c46c
add support for primary key and partition by within DDL, update dml a…
fupelaqu Dec 10, 2025
255b489
add support for scripted column
fupelaqu Dec 10, 2025
8a5c91e
fix painless script for datediff, add ddl column processorScript util…
fupelaqu Dec 10, 2025
7e0279b
add text and keyword types - add ddl processors to remove, rename, se…
fupelaqu Dec 12, 2025
111c091
update index creation api adding optional mappings and aliases
fupelaqu Dec 13, 2025
f581d43
add support for _id and _ingest.timestamp as default values
fupelaqu Dec 13, 2025
fa2f6ab
add object value, generate index mappings, settings and pipeline from…
fupelaqu Dec 15, 2025
65766e7
update parser specifications
fupelaqu Dec 15, 2025
0d1930a
update elastic index definition
fupelaqu Dec 15, 2025
edaa37b
convert elastic index mappings and settings to DdlTable
fupelaqu Dec 16, 2025
de79489
add struct type to the parser, add support for scripts within fields,…
fupelaqu Dec 16, 2025
47d0abb
add alter table statements (alter/drop column script, field, comment,…
fupelaqu Dec 17, 2025
372a291
compute diff between 2 ddl tables
fupelaqu Dec 17, 2025
05950c8
fix _meta for mappings
fupelaqu Dec 17, 2025
d88f660
add support for create, alter and drop ddl queries for pipelines
fupelaqu Dec 18, 2025
c1d0457
update ddl table merge with field statements
fupelaqu Dec 18, 2025
07b0ef3
update ddl table diff for fields, mappings and settings
fupelaqu Dec 18, 2025
26777b0
update documentation related to ddl support
fupelaqu Dec 18, 2025
898db77
update column options, mappings and settings using Object Value set a…
fupelaqu Dec 18, 2025
91a27b8
to fix compilation errors with scala 2.12
fupelaqu Dec 18, 2025
ebeb1e7
add pipeline api
fupelaqu Dec 19, 2025
64a65df
finalize pipeline api - fix painless script with current date time
fupelaqu Dec 21, 2025
4558dbf
add support for template api
fupelaqu Dec 22, 2025
a477789
finalize template api
fupelaqu Dec 22, 2025
bee01d1
add template api documentation
fupelaqu Dec 22, 2025
5e99ae1
refactoring traits and classes inside schema packages, add get index api
fupelaqu Dec 24, 2025
4ec5e96
finalize get index api, fix bulk api for java client
fupelaqu Dec 24, 2025
be72b72
retrieve table default and final pipelines
fupelaqu Dec 25, 2025
304f969
set table default and final pipelines names
fupelaqu Dec 25, 2025
2c9655a
add pipeline api with Pipeline statement
fupelaqu Dec 25, 2025
2836353
add table statement trait
fupelaqu Dec 25, 2025
caa88d1
implements isIndexClosed, truncateIndex and deleteByQuery - fix retri…
fupelaqu Dec 27, 2025
aaeae3b
fix alias exists api with es6, add waitForShards for es6 ensuring ind…
fupelaqu Dec 27, 2025
abb7f45
fix index creation with mappings for es6
fupelaqu Dec 27, 2025
1c8ebaa
add support for updateByQuery
fupelaqu Dec 28, 2025
4a95927
add documentation for updateByQuery
fupelaqu Dec 28, 2025
db049e6
add support for indexByQuery
fupelaqu Dec 28, 2025
88f54db
fix double refresh
fupelaqu Dec 29, 2025
4dc2d66
init SQL gateway
fupelaqu Dec 31, 2025
f68234a
add headers
fupelaqu Dec 31, 2025
b3bbc32
add support for SHOW and DESCRIBE TABLE, add SQL Gateway specifications
fupelaqu Dec 31, 2025
327deb1
to fix doc values with inner hits
fupelaqu Jan 5, 2026
ddcd9b3
implements Updatable with arithmetic expressions
fupelaqu Jan 5, 2026
c14283b
remove unnecessary printing
fupelaqu Jan 5, 2026
ccb5ee2
to fix multi queries (UNION ALL)
fupelaqu Jan 5, 2026
cb52628
to fix script fields within results
fupelaqu Jan 5, 2026
84f5887
to fix painless scripts for substring, left and right string functions
fupelaqu Jan 5, 2026
971be41
to fix painless scripts with system functions
fupelaqu Jan 5, 2026
682e1cd
to fix painless scripts with temporal function to apply first
fupelaqu Jan 5, 2026
cc00710
to fix painless script for diff function
fupelaqu Jan 5, 2026
61cd6f5
to fix windowing with scroll api
fupelaqu Jan 6, 2026
cf03671
to fix painless scripts with math functions
fupelaqu Jan 6, 2026
08e7900
to fix isWindowing for window functions
fupelaqu Jan 6, 2026
53caa7f
to fix elastic conversion with nested / object field aliases
fupelaqu Jan 6, 2026
abf9b14
to fix distance painless script
fupelaqu Jan 6, 2026
937566e
to fix function with nested element(s)
fupelaqu Jan 6, 2026
356922a
to fix client specifications with nested documents
fupelaqu Jan 6, 2026
ac41aba
to fix selected fields with nested documents
fupelaqu Jan 6, 2026
7f725fb
to fix windows enrichment conditions
fupelaqu Jan 6, 2026
18bccf0
finalize SQL Gateway
fupelaqu Jan 6, 2026
ff7be3e
fix mapping api specifications
fupelaqu Jan 6, 2026
3db4906
fix parser specifications
fupelaqu Jan 6, 2026
52894b5
fix sql query specifications
fupelaqu Jan 6, 2026
53cb302
fix jest specifications
fupelaqu Jan 6, 2026
8dd20e5
add SQL Gateway delegators
fupelaqu Jan 6, 2026
947e340
update RHL client specifications using ElasticDockerTestKit
fupelaqu Jan 6, 2026
43920d9
add support for SHOW and DESCRIBE PIPELINE
fupelaqu Jan 7, 2026
eae0a6c
add support for COPY INTO
fupelaqu Jan 7, 2026
62dd7b0
update alter table statements
fupelaqu Jan 7, 2026
8ccb04c
fix parser keywords
fupelaqu Jan 7, 2026
d48363f
update ddl documentation
fupelaqu Jan 7, 2026
a436afa
update dml documentation
fupelaqu Jan 7, 2026
cb56562
update dql documentation
fupelaqu Jan 7, 2026
8e3b8cc
update dql documentation
fupelaqu Jan 7, 2026
c949982
update dml documentation
fupelaqu Jan 7, 2026
f718d21
update ddl documentation
fupelaqu Jan 7, 2026
69b6257
minor update
fupelaqu Jan 7, 2026
661b1cd
add documentation for Gateway api - implements SHOW CREATE TABLE / PI…
fupelaqu Jan 7, 2026
a9e1b77
fix create table with primary key
fupelaqu Jan 7, 2026
9cb1f62
add Gateway api to main README.md
fupelaqu Jan 7, 2026
e9e5a9d
add Gateway diagrams
fupelaqu Jan 7, 2026
0c78af3
rename default value processor to set processor, replace sql field wi…
fupelaqu Jan 9, 2026
de6523e
fix DataIndexName
fupelaqu Jan 9, 2026
f3d2ddd
fix DataIndexName
fupelaqu Jan 9, 2026
9119b3f
add artificial primary key while creating a new table if no primary k…
fupelaqu Jan 9, 2026
9ed9e09
to fix infinite loops
fupelaqu Jan 10, 2026
b2b10b0
clean import
fupelaqu Jan 10, 2026
1c2a550
fix scala fmt
fupelaqu Jan 11, 2026
370ea41
add optional table to identifier
fupelaqu Jan 11, 2026
8a49bad
add enrich processor type
fupelaqu Jan 11, 2026
06aada6
fix from validation when multiple tables are involved without joins
fupelaqu Jan 11, 2026
38ae45c
to fix set processor
fupelaqu Jan 12, 2026
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
149 changes: 126 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,23 @@ SoftClient4ES provides a trait-based interface (`ElasticClientApi`) that aggrega

#### **Core APIs**

| API | Description | Documentation |
|------------------------------------------------------------|-------------------------------------------------------------------------------------|-------------------------------------------------|
| **[RefreshApi](documentation/client/refresh.md)** | Control index refresh for real-time search | [📖 Docs](documentation/client/refresh.md) |
| **[IndicesApi](documentation/client/indices.md)** | Create, update, and manage indices with settings and mappings | [📖 Docs](documentation/client/indices.md) |
| **[SettingsApi](documentation/client/settings.md)** | Dynamic index settings management | [📖 Docs](documentation/client/settings.md) |
| **[AliasApi](documentation/client/aliases.md)** | Manage index aliases for zero-downtime deployments | [📖 Docs](documentation/client/aliases.md) |
| **[MappingApi](documentation/client/mappings.md)** | Smart mapping management with automatic migration and rollback | [📖 Docs](documentation/client/mappings.md) |
| **[IndexApi](documentation/client/index.md)** | Index documents | [📖 Docs](documentation/client/index.md) |
| **[UpdateApi](documentation/client/update.md)** | Partial document updates with script support | [📖 Docs](documentation/client/update.md) |
| **[DeleteApi](documentation/client/delete.md)** | Delete documents by ID or query | [📖 Docs](documentation/client/delete.md) |
| **[BulkApi](documentation/client/bulk.md)** | High-performance bulk operations with Akka Streams | [📖 Docs](documentation/client/bulk.md) |
| **[GetApi](documentation/client/get.md)** | Get documents by ID | [📖 Docs](documentation/client/get.md) |
| **[SearchApi](documentation/client/search.md)** | Advanced search with SQL and aggregations support | [📖 Docs](documentation/client/search.md) |
| **[ScrollApi](documentation/client/scroll.md)** | Stream large datasets with automatic strategy detection (PIT, search_after, scroll) | [📖 Docs](documentation/client/scroll.md) |
| API | Description | Documentation |
|--------------------------------------------------------|-------------------------------------------------------------------------------------|-------------------------------------------------|
| **[RefreshApi](documentation/client/refresh.md)** | Control index refresh for real-time search | [📖 Docs](documentation/client/refresh.md) |
| **[IndicesApi](documentation/client/indices.md)** | Create, update, and manage indices with settings and mappings | [📖 Docs](documentation/client/indices.md) |
| **[SettingsApi](documentation/client/settings.md)** | Dynamic index settings management | [📖 Docs](documentation/client/settings.md) |
| **[AliasApi](documentation/client/aliases.md)** | Manage index aliases for zero-downtime deployments | [📖 Docs](documentation/client/aliases.md) |
| **[MappingApi](documentation/client/mappings.md)** | Smart mapping management with automatic migration and rollback | [📖 Docs](documentation/client/mappings.md) |
| **[IndexApi](documentation/client/index.md)** | Index documents | [📖 Docs](documentation/client/index.md) |
| **[UpdateApi](documentation/client/update.md)** | Partial document updates with script support | [📖 Docs](documentation/client/update.md) |
| **[DeleteApi](documentation/client/delete.md)** | Delete documents by ID or query | [📖 Docs](documentation/client/delete.md) |
| **[BulkApi](documentation/client/bulk.md)** | High-performance bulk operations with Akka Streams | [📖 Docs](documentation/client/bulk.md) |
| **[GetApi](documentation/client/get.md)** | Get documents by ID | [📖 Docs](documentation/client/get.md) |
| **[SearchApi](documentation/client/search.md)** | Advanced search with SQL and aggregations support | [📖 Docs](documentation/client/search.md) |
| **[ScrollApi](documentation/client/scroll.md)** | Stream large datasets with automatic strategy detection (PIT, search_after, scroll) | [📖 Docs](documentation/client/scroll.md) |
| **[AggregationApi](documentation/client/aggregations.md)** | Type-safe way to execute aggregations using SQL queries | [📖 Docs](documentation/client/aggregations.md) |
| **[TemplateApi](documentation/client/templates.md)** | Templates management | [📖 Docs](documentation/client/templates.md) |
| **[GatewayApi](documentation/client/gateway.md)** | Unified SQL interface for DQL, DML, and DDL statements | [📖 Docs](documentation/client/gateway.md) |

#### **Client Implementations**

Expand Down Expand Up @@ -181,7 +183,105 @@ result match {

### **3. SQL compatible**

### **3.1 SQL to Elasticsearch Query DSL**
### **3.1 SQL Gateway — Unified SQL Interface for Elasticsearch**

SoftClient4ES includes a high‑level SQL Gateway that allows you to execute **DQL, DML, DDL, and Pipeline statements** directly against Elasticsearch using standard SQL syntax.

The Gateway exposes a single entry point:

```scala
gateway.run(sql: String): Future[ElasticResult[QueryResult]]
```

It automatically:

- normalizes SQL (removes comments, trims whitespace)
- parses SQL into AST nodes
- routes statements to the appropriate executor
- returns a typed `QueryResult` (`QueryRows`, `TableResult`, `PipelineResult`, `DmlResult`, `DdlResult`, `SQLResult`)

#### **Architecture Diagram — SQL Gateway**

```text
+----------------------+
| GatewayApi |
| run(sql: String) |
+----------+-----------+
|
v
+----------------------+
| Parser |
| SQL → Statement |
+----------+-----------+
|
------------------------------------------------
| | |
v v v
+---------------+ +---------------+ +----------------+
| DqlStatement | | DmlStatement | | DdlStatement |
+-------+-------+ +-------+-------+ +--------+-------+
| | |
v v v
+---------------+ +---------------+ +----------------------+
| DqlExecutor | | DmlExecutor | | DdlRouterExecutor |
+-------+-------+ +-------+-------+ +----------+-----------+
/ \
/ \
v v
+----------------+ +------------------+
| TableExecutor | | PipelineExecutor |
+--------+-------+ +--------+---------+
| |
v v
+-----------+ +-----------+
|ElasticSearch| |ElasticSearch|
+-----------+ +-----------+

+-----------------------------------------------+
| QueryResult |
+-----------------------------------------------+
| QueryRows | QueryStream | QueryStructured |
| DmlResult | DdlResult | TableResult |
| PipelineResult | SQLResult (SHOW CREATE) |
+-----------------------------------------------+
```

---

#### **Supported SQL Categories**

| Category | Examples |
|---------------------|--------------------------------------------------------------------------------------------------------------------|
| **DQL** | `SELECT`, `JOIN UNNEST`, `GROUP BY`, `HAVING`, window functions |
| **DML** | `INSERT`, `UPDATE`, `DELETE`, `COPY INTO` |
| **DDL (Tables)** | `CREATE TABLE`, `ALTER TABLE`, `DROP TABLE`, `TRUNCATE TABLE`, `DESCRIBE TABLE`, `SHOW TABLE`, `SHOW CREATE TABLE` |
| **DDL (Pipelines)** | `CREATE PIPELINE`, `ALTER PIPELINE`, `DROP PIPELINE`, `DESCRIBE PIPELINE`, `SHOW PIPELINE`, `SHOW CREATE PIPELINE` |

#### **Example**

```scala
gateway.run("""
CREATE TABLE users (
id INT,
name TEXT,
age INT,
PRIMARY KEY (id)
);
INSERT INTO users VALUES (1, 'Alice', 30);
SELECT * FROM users;
""")
```

#### **Documentation**

- 📘 **Gateway API** — `documentation/client/gateway.md`
- 📘 **DQL** — `documentation/sql/dql_statements.md`
- 📘 **DML** — `documentation/sql/dml_statements.md`
- 📘 **DDL** — `documentation/sql/ddl_statements.md`

---

### **3.2 SQL to Elasticsearch Query DSL**

SoftClient4ES includes a powerful SQL parser that translates standard SQL `SELECT` queries into native Elasticsearch queries.

Expand Down Expand Up @@ -210,6 +310,9 @@ SoftClient4ES includes a powerful SQL parser that translates standard SQL `SELEC
- ✅ Date / Time functions (`YEAR`, `QUARTER`, `MONTH`, `WEEK`, `DAY`, `HOUR`, `MINUTE`, `SECOND`, `MILLISECOND`, `MICROSECOND`, `NANOSECOND`, `EPOCHDAY`, `OFFSET_SECONDS`, `LAST_DAY`, `WEEKDAY`, `YEARDAY`, `INTERVAL`, `CURRENT_DATE`, `CURDATE`, `TODAY`, `NOW`, `CURRENT_TIME`, `CURTIME`, `CURRENT_DATETIME`, `CURRENT_TIMESTAMP`, `DATE_ADD`, `DATEADD`, `DATE_SUB`, `DATESUB`, `DATETIME_ADD`, `DATETIMEADD`, `DATETIME_SUB`, `DATETIMESUB`, `DATE_DIFF`, `DATEDIFF`, `DATE_FORMAT`, `DATE_PARSE`, `DATETIME_FORMAT`, `DATETIME_PARSE`, `DATE_TRUNC`, `EXTRACT`)
- ✅ Geospatial functions (`POINT`, `ST_DISTANCE`)
- ✅ Aggregate functions (`COUNT`, `SUM`, `AVG`, `MIN`, `MAX`, `DISTINCT`, `FIRST_VALUE`, `LAST_VALUE`, `ARRAY_AGG`)
- ✅ [Window functions](#32-window-functions-support) with `OVER` clause
- ✅ [DML Support](#34-dml-support) (`INSERT`, `UPDATE`, `DELETE`)
- ✅ [DDL Support](#35-ddl-support) (`CREATE TABLE`, `ALTER TABLE`, `DROP TABLE`, `TRUNCATE TABLE`, `CREATE PIPELINE`, `ALTER PIPELINE`, `DROP PIPELINE`)

**Example:**

Expand Down Expand Up @@ -1188,6 +1291,8 @@ client.searchAsUnchecked[Product](SQLQuery(dynamicQuery))
client.scrollAsUnchecked[Product](dynamicQuery)
```

---

📖 **[Full SQL Validation Documentation](documentation/sql/validation.md)**

📖 **[Full SQL Documentation](documentation/sql/README.md)**
Expand Down Expand Up @@ -1517,18 +1622,18 @@ ThisBuild / resolvers ++= Seq(

// For Elasticsearch 6
// Using Jest client
libraryDependencies += "app.softnetwork.elastic" %% s"softclient4es6-jest-client" % 0.14.2
libraryDependencies += "app.softnetwork.elastic" %% s"softclient4es6-jest-client" % 0.15.0
// Or using Rest High Level client
libraryDependencies += "app.softnetwork.elastic" %% s"softclient4es6-rest-client" % 0.14.2
libraryDependencies += "app.softnetwork.elastic" %% s"softclient4es6-rest-client" % 0.15.0

// For Elasticsearch 7
libraryDependencies += "app.softnetwork.elastic" %% s"softclient4es7-rest-client" % 0.14.2
libraryDependencies += "app.softnetwork.elastic" %% s"softclient4es7-rest-client" % 0.15.0

// For Elasticsearch 8
libraryDependencies += "app.softnetwork.elastic" %% s"softclient4es8-java-client" % 0.14.2
libraryDependencies += "app.softnetwork.elastic" %% s"softclient4es8-java-client" % 0.15.0

// For Elasticsearch 9
libraryDependencies += "app.softnetwork.elastic" %% s"softclient4es9-java-client" % 0.14.2
libraryDependencies += "app.softnetwork.elastic" %% s"softclient4es9-java-client" % 0.15.0
```

### **Quick Example**
Expand Down Expand Up @@ -1567,12 +1672,10 @@ client.createIndex("users", mapping) match {

### **Short-term**

- [ ] Support for `INSERT`, `UPDATE`, `DELETE` SQL operations
- [ ] Support for `CREATE TABLE`, `ALTER TABLE` SQL operations
- [ ] Full **JDBC connector for Elasticsearch**

### **Long-term**

- [ ] Full **JDBC connector for Elasticsearch**
- [ ] Advanced monitoring and metrics

---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import app.softnetwork.elastic.sql.query.{
Asc,
BucketIncludesExcludes,
BucketNode,
BucketTree,
Criteria,
Desc,
Field,
Expand Down Expand Up @@ -101,7 +100,7 @@ object ElasticAggregation {
having: Option[Criteria],
bucketsDirection: Map[String, SortOrder],
allAggregations: Map[String, SQLAggregation]
): ElasticAggregation = {
)(implicit timestamp: Long): ElasticAggregation = {
import sqlAgg._
val sourceField = identifier.path

Expand Down Expand Up @@ -156,14 +155,14 @@ object ElasticAggregation {
if (transformFuncs.nonEmpty) {
val context = PainlessContext()
val scriptSrc = identifier.painless(Some(context))
val script = Script(s"$context$scriptSrc").lang("painless")
val script = now(Script(s"$context$scriptSrc").lang("painless"))
buildScript(aggName, script)
} else {
aggType match {
case th: WindowFunction if th.shouldBeScripted =>
val context = PainlessContext()
val scriptSrc = th.identifier.painless(Some(context))
val script = Script(s"$context$scriptSrc").lang("painless")
val script = now(Script(s"$context$scriptSrc").lang("painless"))
buildScript(aggName, script)
case _ => buildField(aggName, sourceField)
}
Expand Down Expand Up @@ -231,7 +230,7 @@ object ElasticAggregation {
.filter(_.isScriptField)
.groupBy(_.sourceField)
.map(_._2.head)
.map(f => f.sourceField -> Script(f.painless(None)).lang("painless"))
.map(f => f.sourceField -> now(Script(f.painless(None)).lang("painless")))
.toMap,
size = limit,
sorts = th.orderBy
Expand Down Expand Up @@ -269,14 +268,14 @@ object ElasticAggregation {
val painless = script.identifier.painless(None)
bucketScriptAggregation(
aggName,
Script(s"$painless").lang("painless"),
now(Script(s"$painless").lang("painless")),
params.toMap
)
case _ =>
throw new IllegalArgumentException(s"Unsupported aggregation type: $aggType")
}

val nestedElement = identifier.nestedElement
val nestedElement = sqlAgg.nestedElement

val nestedElements: Seq[NestedElement] =
nestedElement.map(n => NestedElements.buildNestedTrees(Seq(n))).getOrElse(Nil)
Expand Down Expand Up @@ -349,11 +348,7 @@ object ElasticAggregation {
having: Option[Criteria],
nested: Option[NestedElement],
allElasticAggregations: Seq[ElasticAggregation]
): Seq[Aggregation] = {
val trees = BucketTree(buckets.flatMap(_.headOption))
println(
s"[DEBUG] buildBuckets called with buckets: \n$trees"
)
)(implicit timestamp: Long): Seq[Aggregation] = {
for (tree <- buckets) yield {
val treeNodes =
tree.sortBy(_.level).reverse.foldLeft(Seq.empty[NodeAggregation]) { (current, node) =>
Expand All @@ -371,7 +366,7 @@ object ElasticAggregation {
if (!bucket.isBucketScript && bucket.shouldBeScripted) {
val context = PainlessContext()
val painless = bucket.painless(Some(context))
Some(Script(s"$context$painless").lang("painless"))
Some(now(Script(s"$context$painless").lang("painless")))
} else {
None
}
Expand Down Expand Up @@ -520,7 +515,7 @@ object ElasticAggregation {
val bucketSelector =
bucketSelectorAggregation(
"having_filter",
Script(script),
now(Script(script)),
extractMetricsPathForBucket(
criteria,
nested,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ case class ElasticBridge(filter: ElasticFilter) {
def query(
innerHitsNames: Set[String] = Set.empty,
currentQuery: Option[ElasticBoolQuery]
): Query = {
)(implicit timestamp: Long): Query = {
filter match {
case boolQuery: ElasticBoolQuery =>
import boolQuery._
Expand Down Expand Up @@ -77,13 +77,10 @@ case class ElasticBridge(filter: ElasticFilter) {
case _ =>
}
if (n.sources.nonEmpty) {
inner = inner.fetchSource(
FetchSourceContext(
fetchSource = true,
includes = n.sources.map { source =>
(n.path.split('.').toSeq ++ Seq(source)).mkString(".")
}.toArray
)
inner = inner.docValueFields(
n.sources.map { source =>
(n.path.split('.').toSeq ++ Seq(source)).mkString(".")
}
)
}
inner
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ import com.sksamuel.elastic4s.requests.searches.queries.Query

case class ElasticCriteria(criteria: Criteria) {

def asQuery(group: Boolean = true, innerHitsNames: Set[String] = Set.empty): Query = {
def asQuery(group: Boolean = true, innerHitsNames: Set[String] = Set.empty)(implicit
timestamp: Long
): Query = {
val query = criteria.boolQuery.copy(group = group)
query
.filter(criteria.asFilter(Option(query)))
Expand Down
Loading