From c80d36706bea6d9a2a0d52dc8108d1f0480351ed Mon Sep 17 00:00:00 2001 From: James Rodewig <40268737+jrodewig@users.noreply.github.com> Date: Wed, 12 Aug 2020 09:50:27 -0400 Subject: [PATCH] [DOCS] Fix index boost snippet (#61023) (#61025) Updates the `indices_boost` snippet to use the `my-index-000001` index. Removes a related REST test. --- docs/build.gradle | 14 -------------- .../search/request/index-boost.asciidoc | 18 +++++++++--------- 2 files changed, 9 insertions(+), 23 deletions(-) diff --git a/docs/build.gradle b/docs/build.gradle index c6b08241fff..9c13e00daf9 100644 --- a/docs/build.gradle +++ b/docs/build.gradle @@ -372,20 +372,6 @@ buildRestTests.doFirst { buildRestTests.setups['bank'].replace('#bank_data#', accounts) } -// Used by index boost doc -buildRestTests.setups['index_boost'] = ''' - - do: - indices.create: - index: index1 - - do: - indices.create: - index: index2 - - - do: - indices.put_alias: - index: index1 - name: alias1 -''' // Used by sampler and diversified-sampler aggregation docs buildRestTests.setups['stackoverflow'] = ''' - do: diff --git a/docs/reference/search/request/index-boost.asciidoc b/docs/reference/search/request/index-boost.asciidoc index 381cb75b254..4eb0654b486 100644 --- a/docs/reference/search/request/index-boost.asciidoc +++ b/docs/reference/search/request/index-boost.asciidoc @@ -10,13 +10,13 @@ coming from one index matter more than hits coming from another index. -------------------------------------------------- GET /_search { - "indices_boost" : { - "index1" : 1.4, - "index2" : 1.3 - } + "indices_boost": [ + { "my-index-000001": 1.4 }, + { "my-index-000002": 1.3 } + ] } -------------------------------------------------- -// TEST[setup:index_boost warning:Object format in indices_boost is deprecated, please use array format instead] +// TEST[s/^/PUT my-index-000001\nPUT my-index-000002\n/] You can also specify it as an array to control the order of boosts. @@ -24,13 +24,13 @@ You can also specify it as an array to control the order of boosts. -------------------------------------------------- GET /_search { - "indices_boost" : [ - { "alias1" : 1.4 }, - { "index*" : 1.3 } + "indices_boost": [ + { "my-alias": 1.4 }, + { "my-index*": 1.3 } ] } -------------------------------------------------- -// TEST[continued] +// TEST[s/^/PUT my-index-000001\nPUT my-index-000001\/_alias\/my-alias\n/] This is important when you use aliases or wildcard expression. If multiple matches are found, the first match will be used.