Skip to content

Commit 206bf59

Browse files
authored
[DOCS] Fix index boost snippet (#61023) (#61027)
Updates the `indices_boost` snippet to use the `my-index-000001` index. Removes a related REST test.
1 parent c5c1e10 commit 206bf59

File tree

2 files changed

+9
-23
lines changed

2 files changed

+9
-23
lines changed

docs/build.gradle

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -346,20 +346,6 @@ buildRestTests.doFirst {
346346
buildRestTests.setups['bank'].replace('#bank_data#', accounts)
347347
}
348348

349-
// Used by index boost doc
350-
buildRestTests.setups['index_boost'] = '''
351-
- do:
352-
indices.create:
353-
index: index1
354-
- do:
355-
indices.create:
356-
index: index2
357-
358-
- do:
359-
indices.put_alias:
360-
index: index1
361-
name: alias1
362-
'''
363349
// Used by sampler and diversified-sampler aggregation docs
364350
buildRestTests.setups['stackoverflow'] = '''
365351
- do:

docs/reference/search/request/index-boost.asciidoc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,27 @@ coming from one index matter more than hits coming from another index.
1010
--------------------------------------------------
1111
GET /_search
1212
{
13-
"indices_boost" : {
14-
"index1" : 1.4,
15-
"index2" : 1.3
16-
}
13+
"indices_boost": [
14+
{ "my-index-000001": 1.4 },
15+
{ "my-index-000002": 1.3 }
16+
]
1717
}
1818
--------------------------------------------------
19-
// TEST[setup:index_boost warning:Object format in indices_boost is deprecated, please use array format instead]
19+
// TEST[s/^/PUT my-index-000001\nPUT my-index-000002\n/]
2020

2121
You can also specify it as an array to control the order of boosts.
2222

2323
[source,console]
2424
--------------------------------------------------
2525
GET /_search
2626
{
27-
"indices_boost" : [
28-
{ "alias1" : 1.4 },
29-
{ "index*" : 1.3 }
27+
"indices_boost": [
28+
{ "my-alias": 1.4 },
29+
{ "my-index*": 1.3 }
3030
]
3131
}
3232
--------------------------------------------------
33-
// TEST[continued]
33+
// TEST[s/^/PUT my-index-000001\nPUT my-index-000001\/_alias\/my-alias\n/]
3434

3535
This is important when you use aliases or wildcard expression.
3636
If multiple matches are found, the first match will be used.

0 commit comments

Comments
 (0)