Browse Source

[DOCS] Fix transform painless example syntax (#88364)

Corrects the syntax of an example for a scripted metric aggregation.
eltomello 3 years ago
parent
commit
df7ea6afcd
1 changed files with 2 additions and 2 deletions
  1. 2 2
      docs/reference/transform/painless-examples.asciidoc

+ 2 - 2
docs/reference/transform/painless-examples.asciidoc

@@ -573,7 +573,7 @@ POST _transform/_preview
                 all_docs.add(span); 
               }
             }
-            all_docs.sort((HashMap o1, HashMap o2)->o1['@timestamp'].toEpochMilli()compareTo(o2['@timestamp']-toEpochMilli())); 
+            all_docs.sort((HashMap o1, HashMap o2)->o1['@timestamp'].toEpochMilli().compareTo(o2['@timestamp'].toEpochMilli())); 
             def size = all_docs.size();
             def min_time = all_docs[0]['@timestamp'];
             def max_time = all_docs[size-1]['@timestamp'];
@@ -644,4 +644,4 @@ The API call results in a similar response:
 }
 ...
 --------------------------------------------------
-// NOTCONSOLE
+// NOTCONSOLE