# Can boost change dynamically?

**URL:** <https://www.ruby-forum.com/t/can-boost-change-dynamically/113737>\
**Category:** Ferret\
**Created:** [September 4, 2007, 3:04pm UTC](https://www.ruby-forum.com/t/can-boost-change-dynamically/113737 "2007-09-04T15:04:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![golak\_Sarangi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/3bc359/32.png) [@golak\_Sarangi](https://www.ruby-forum.com/u/golak_Sarangi)\
**Post date:** [September 4, 2007, 3:04pm UTC](https://www.ruby-forum.com/t/can-boost-change-dynamically/113737/1 "2007-09-04T15:04:11Z")

</div>

Hi,

I have got a peculiar requirement in my project. I need to apply some  
boost  
to different fields of my index. But the problem is the boost that  
needs to  
be applied is dynamic. It changes for everyrow of data.I am storing that  
in  
the index itself while building it. Is there anyway by which i can add  
the  
boost to search query while searching. at present am retreiving the  
whole  
set of searched result and then manipulating with the score to get the  
output. but by that way it gets too slow. can any one help me.

---

<div class="post-metadata">

**Author:** ![golak\_Sarangi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/3bc359/32.png) [@golak\_Sarangi](https://www.ruby-forum.com/u/golak_Sarangi)\
**Post date:** [September 4, 2007, 3:08pm UTC](https://www.ruby-forum.com/t/can-boost-change-dynamically/113737/2 "2007-09-04T15:08:12Z")

</div>

On Tue, Sep 04, 2007 at 06:33:20PM +0530, golak Sarangi wrote:

> Hi,
> 
> I have got a peculiar requirement in my project. I need to apply some boost  
> to different fields of my index. But the problem is the boost that needs to  
> be applied is dynamic. It changes for everyrow of data.I am storing that in  
> the index itself while building it. Is there anyway by which i can add the  
> boost to search query while searching. at present am retreiving the whole  
> set of searched result and then manipulating with the score to get the  
> output. but by that way it gets too slow. can any one help me.

did you search the archives for this? Imho this topic came up a few days  
(or weeks?) ago.

Short answer: \<ou can set the boost on a per document basis at indexing  
time, see the API docs for Ferret’s Document class.

Cheers,  
Jens

–  
Jens Krämer  
webit! Gesellschaft für neue Medien mbH  
Schnorrstraße 76 | 01069 Dresden  
Telefon +49 351 46766-0 | Telefax +49 351 46766-66  
removed\_email\_address@domain.invalid | [www.webit.de](http://www.webit.de)

Amtsgericht Dresden | HRB 15422  
GF Sven Haubold, Hagen Malessa
