Boost at index time and search time

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Boost at index time and search time

Clinton Gormley
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.

Reply | Threaded
Open this post in threaded view
|

Re: Boost at index time and search time

kimchy
Administrator
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 <[hidden email]> wrote:
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.