Setting the boost field after indexing

I was wondering about the potential impact of setting the boost field
for an
index after the index has been created and optimized.

I know that some field_info settings can’t really be modified, such as
:store or :tokenize, as they really apply when you are indexing, but is
boost? If boost is only used for searching, can it be modified
dynamically
when searching?

Thanks for any thoughts.

On 10/17/06, peter [email protected] wrote:

I was wondering about the potential impact of setting the boost field for an
index after the index has been created and optimized.

I know that some field_info settings can’t really be modified, such as
:store or :tokenize, as they really apply when you are indexing, but is
boost? If boost is only used for searching, can it be modified dynamically
when searching?

Thanks for any thoughts.

Hi Peter,

If you want to set boosts at search time you can set the boost on the
query. For example:

+title:ferret^20.0 +content:ruby content:rails^0.1

Does that solve your problem? Otherwise, changing the boost on fields
is just as problematic as changing the :store or :tokenized values. At
indexing time the the global field boost, the local field boost, the
document boost and the field length normalization factor are all
multiplied together to get a single normalization factor for that
field. This value is then encoded as a single byte and stored in the
norm file (which you can omit to save space by setting :index =>
:untokenized_omit_norms). This saves a lot of work at search time but
it also makes it impossible to change the global field boost value at
search time.

Anyway, I hope this clears things up and the query boosting does what
you need it to.

Cheers,
Dave