2019-07-17 08:49:22 -04:00
|
|
|
[[request-body-search-index-boost]]
|
2019-07-19 14:35:36 -04:00
|
|
|
==== Index Boost
|
2013-08-28 19:24:34 -04:00
|
|
|
|
|
|
|
Allows to configure different boost level per index when searching
|
|
|
|
across more than one indices. This is very handy when hits coming from
|
|
|
|
one index matter more than hits coming from another index (think social
|
|
|
|
graph where each user has an index).
|
|
|
|
|
2016-11-07 03:20:06 -05:00
|
|
|
deprecated[5.2.0, This format is deprecated. Please use array format instead.]
|
2019-09-09 12:35:50 -04:00
|
|
|
[source,console]
|
2013-08-28 19:24:34 -04:00
|
|
|
--------------------------------------------------
|
2016-05-18 07:15:19 -04:00
|
|
|
GET /_search
|
2013-08-28 19:24:34 -04:00
|
|
|
{
|
|
|
|
"indices_boost" : {
|
|
|
|
"index1" : 1.4,
|
|
|
|
"index2" : 1.3
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
2016-11-07 03:20:06 -05:00
|
|
|
// TEST[setup:index_boost warning:Object format in indices_boost is deprecated, please use array format instead]
|
|
|
|
|
|
|
|
You can also specify it as an array to control the order of boosts.
|
|
|
|
|
2019-09-09 12:35:50 -04:00
|
|
|
[source,console]
|
2016-11-07 03:20:06 -05:00
|
|
|
--------------------------------------------------
|
|
|
|
GET /_search
|
|
|
|
{
|
|
|
|
"indices_boost" : [
|
|
|
|
{ "alias1" : 1.4 },
|
|
|
|
{ "index*" : 1.3 }
|
|
|
|
]
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
// TEST[continued]
|
|
|
|
|
|
|
|
This is important when you use aliases or wildcard expression.
|
|
|
|
If multiple matches are found, the first match will be used.
|
|
|
|
For example, if an index is included in both `alias1` and `index*`, boost value of `1.4` is applied.
|