File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
bridge/src/main/scala/app/softnetwork/elastic/sql/bridge
es6/bridge/src/main/scala/app/softnetwork/elastic/sql/bridge Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -167,13 +167,17 @@ object ElasticAggregation {
167167 .fetchSource(
168168 th.identifier.name +: th.fields
169169 .filterNot(_.isScriptField)
170+ .filterNot(_.sourceField == th.identifier.name)
170171 .map(_.sourceField)
172+ .distinct
171173 .toArray,
172174 Array .empty
173175 )
174176 .copy(
175177 scripts = th.fields
176178 .filter(_.isScriptField)
179+ .groupBy(_.sourceField)
180+ .map(_._2.head)
177181 .map(f => f.sourceField -> Script (f.painless(None )).lang(" painless" ))
178182 .toMap
179183 )
Original file line number Diff line number Diff line change @@ -167,13 +167,17 @@ object ElasticAggregation {
167167 .fetchSource(
168168 th.identifier.name +: th.fields
169169 .filterNot(_.isScriptField)
170+ .filterNot(_.sourceField == th.identifier.name)
170171 .map(_.sourceField)
172+ .distinct
171173 .toArray,
172174 Array .empty
173175 )
174176 .copy(
175177 scripts = th.fields
176178 .filter(_.isScriptField)
179+ .groupBy(_.sourceField)
180+ .map(_._2.head)
177181 .map(f => f.sourceField -> Script (f.painless(None )).lang(" painless" ))
178182 .toMap
179183 )
You can’t perform that action at this time.
0 commit comments