Skip to content

Commit c85157f

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

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
@@ -372,20 +372,6 @@ buildRestTests.doFirst {
372372
buildRestTests.setups['bank'].replace('#bank_data#', accounts)
373373
}
374374

375-
// Used by index boost doc
376-
buildRestTests.setups['index_boost'] = '''
377-
- do:
378-
indices.create:
379-
index: index1
380-
- do:
381-
indices.create:
382-
index: index2
383-
384-
- do:
385-
indices.put_alias:
386-
index: index1
387-
name: alias1
388-
'''
389375
// Used by sampler and diversified-sampler aggregation docs
390376
buildRestTests.setups['stackoverflow'] = '''
391377
- 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)