mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-28 17:34:17 -04:00
[DOCS] Change // CONSOLE comments to [source,console] (#46440)
This commit is contained in:
parent
2fe7a0929e
commit
5c78f606c2
167 changed files with 627 additions and 1154 deletions
|
@ -24,7 +24,7 @@ You can execute the script by specifying its `lang` as `expert_scripts`, and the
|
|||
of the script as the script source:
|
||||
|
||||
|
||||
[source,js]
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
POST /_search
|
||||
{
|
||||
|
@ -53,5 +53,4 @@ POST /_search
|
|||
}
|
||||
}
|
||||
--------------------------------------------------
|
||||
// CONSOLE
|
||||
// TEST[skip:we don't have an expert script plugin installed to test this]
|
||||
|
|
|
@ -42,7 +42,7 @@ Here's an example of using a script in a
|
|||
<<query-dsl-function-score-query,`function_score` query>> to alter the
|
||||
relevance `_score` of each document:
|
||||
|
||||
[source,js]
|
||||
[source,console]
|
||||
-------------------------------------
|
||||
PUT my_index/_doc/1?refresh
|
||||
{
|
||||
|
@ -75,7 +75,6 @@ GET my_index/_search
|
|||
}
|
||||
}
|
||||
-------------------------------------
|
||||
// CONSOLE
|
||||
|
||||
|
||||
[float]
|
||||
|
@ -87,7 +86,7 @@ script is to use the `doc['field_name']` syntax, which retrieves the field
|
|||
value from <<doc-values,doc values>>. Doc values are a columnar field value
|
||||
store, enabled by default on all fields except for <<text,analyzed `text` fields>>.
|
||||
|
||||
[source,js]
|
||||
[source,console]
|
||||
-------------------------------
|
||||
PUT my_index/_doc/1?refresh
|
||||
{
|
||||
|
@ -109,7 +108,6 @@ GET my_index/_search
|
|||
}
|
||||
}
|
||||
-------------------------------
|
||||
// CONSOLE
|
||||
|
||||
Doc-values can only return "simple" field values like numbers, dates, geo-
|
||||
points, terms, etc, or arrays of these values if the field is multi-valued.
|
||||
|
@ -170,7 +168,7 @@ doc values.
|
|||
|
||||
For instance:
|
||||
|
||||
[source,js]
|
||||
[source,console]
|
||||
-------------------------------
|
||||
PUT my_index
|
||||
{
|
||||
|
@ -216,7 +214,7 @@ GET my_index/_search
|
|||
}
|
||||
}
|
||||
-------------------------------
|
||||
// CONSOLE
|
||||
|
||||
<1> The `title` field is not stored and so cannot be used with the `_fields[]` syntax.
|
||||
<2> The `title` field can still be accessed from the `_source`.
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ the same pattern:
|
|||
For example, the following script is used in a search request to return a
|
||||
<<request-body-search-script-fields, scripted field>>:
|
||||
|
||||
[source,js]
|
||||
[source,console]
|
||||
-------------------------------------
|
||||
PUT my_index/_doc/1
|
||||
{
|
||||
|
@ -42,7 +42,6 @@ GET my_index/_search
|
|||
}
|
||||
}
|
||||
-------------------------------------
|
||||
// CONSOLE
|
||||
|
||||
[float]
|
||||
=== Script parameters
|
||||
|
@ -144,7 +143,7 @@ The following are examples of using a stored script that lives at
|
|||
|
||||
First, create the script called `calculate-score` in the cluster state:
|
||||
|
||||
[source,js]
|
||||
[source,console]
|
||||
-----------------------------------
|
||||
POST _scripts/calculate-score
|
||||
{
|
||||
|
@ -154,20 +153,18 @@ POST _scripts/calculate-score
|
|||
}
|
||||
}
|
||||
-----------------------------------
|
||||
// CONSOLE
|
||||
|
||||
This same script can be retrieved with:
|
||||
|
||||
[source,js]
|
||||
[source,console]
|
||||
-----------------------------------
|
||||
GET _scripts/calculate-score
|
||||
-----------------------------------
|
||||
// CONSOLE
|
||||
// TEST[continued]
|
||||
|
||||
Stored scripts can be used by specifying the `id` parameters as follows:
|
||||
|
||||
[source,js]
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
GET _search
|
||||
{
|
||||
|
@ -183,16 +180,14 @@ GET _search
|
|||
}
|
||||
}
|
||||
--------------------------------------------------
|
||||
// CONSOLE
|
||||
// TEST[continued]
|
||||
|
||||
And deleted with:
|
||||
|
||||
[source,js]
|
||||
[source,console]
|
||||
-----------------------------------
|
||||
DELETE _scripts/calculate-score
|
||||
-----------------------------------
|
||||
// CONSOLE
|
||||
// TEST[continued]
|
||||
|
||||
[float]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue