[DOCS] Fix index boost snippet (#61023) (#61025)

Updates the `indices_boost` snippet to use the `my-index-000001` index.

Removes a related REST test.
This commit is contained in:
James Rodewig 2020-08-12 09:50:27 -04:00 committed by GitHub
parent bc37b1b2a7
commit c80d36706b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 23 deletions

View File

@ -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:

View File

@ -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.