Boost at index time and search time


(Clinton Gormley) #1

Hiya

If I put this mapping:

properties: {
name: { type: 'string', boost: 2 }, # index_boost
text: { type: 'string', boost: 1 }
}

and then I search for:

curl -XGET 'http://192.168.5.100:9200/_all/_search' -d '
{
"fields" : [],
"query" : {
"disMax" : {
"queries" : [
{
"field" : {
"text" : {
"boost" : 1,
"query" : "Smith"
}
}
},
{
"field" : {
"name" : {
"boost" : 3, # search_boost
"query" : "Smith"
}
}
}
]
}
}
}
'

Does that mean that the final calculated boost for 'name' is 6
(ie index_boost * search_boost)?

Or is it 3 (ie search_boost || index_boost) ?

thanks

Clint

--
Web Announcements Limited is a company registered in England and Wales,
with company number 05608868, with registered address at 10 Arvon Road,
London, N5 1PR.


(Shay Banon) #2

Its a bit more complex than a simple equation, but you can treat it as
multiplication.

-shay.banon

On Fri, Mar 12, 2010 at 3:12 PM, Clinton Gormley clinton@iannounce.co.ukwrote:

Hiya

If I put this mapping:

properties: {
name: { type: 'string', boost: 2 }, # index_boost
text: { type: 'string', boost: 1 }
}

and then I search for:

curl -XGET 'http://192.168.5.100:9200/_all/_search' -d '
{
"fields" : [],
"query" : {
"disMax" : {
"queries" : [
{
"field" : {
"text" : {
"boost" : 1,
"query" : "Smith"
}
}
},
{
"field" : {
"name" : {
"boost" : 3, # search_boost
"query" : "Smith"
}
}
}
]
}
}
}
'

Does that mean that the final calculated boost for 'name' is 6
(ie index_boost * search_boost)?

Or is it 3 (ie search_boost || index_boost) ?

thanks

Clint

--
Web Announcements Limited is a company registered in England and Wales,
with company number 05608868, with registered address at 10 Arvon Road,
London, N5 1PR.


(system) #3