mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-25 09:28:27 +00:00
Switch stored script example to script_score query (#47691)
The example use of a scoring script was incorrectly using a filter script query, which has no scoring, and thus no _score variable avialable. This commit converts the example doc to using the newer script_score query.
This commit is contained in:
parent
39ef795085
commit
8c6d1e0a08
@ -153,6 +153,7 @@ POST _scripts/calculate-score
|
||||
}
|
||||
}
|
||||
-----------------------------------
|
||||
// TEST[setup:twitter]
|
||||
|
||||
This same script can be retrieved with:
|
||||
|
||||
@ -166,10 +167,15 @@ Stored scripts can be used by specifying the `id` parameters as follows:
|
||||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
GET _search
|
||||
GET twitter/_search
|
||||
{
|
||||
"query": {
|
||||
"script": {
|
||||
"script_score": {
|
||||
"query": {
|
||||
"match": {
|
||||
"message": "some message"
|
||||
}
|
||||
},
|
||||
"script": {
|
||||
"id": "calculate-score",
|
||||
"params": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user