Browse Source

[DOCS] Update runtime fields for script query (#71338)

Fixes typo, moves example out of a NOTE admonition, and puts context before the example.
Adam Locke 4 years ago
parent
commit
af700f4628
1 changed files with 6 additions and 7 deletions
  1. 6 7
      docs/reference/query-dsl/script-query.asciidoc

+ 6 - 7
docs/reference/query-dsl/script-query.asciidoc

@@ -77,10 +77,11 @@ GET /_search
 ----
 ////
 
-
-[NOTE]
-====
-Doing this with runtime fields would looke like:
+You can achieve the same results in a search
+query by using runtime fields. Use the
+<<search-fields,`fields`>> parameter on the 
+`_search` API to fetch values as part of the
+same query:
 
 [source,console]
 ----
@@ -107,13 +108,11 @@ GET /_search
       }
     }
   },
-  "fields": [{"field": "amount.signed"}] <1>
+  "fields": [{"field": "amount.signed"}]
 }
 ----
 // TEST[setup:ledger]
 // TEST[s/_search/_search?filter_path=hits.hits.fields&sort=amount.signed:desc/]
-<1> You can fetch the values too!
-====
 
 ////
 [source,console-result]