Forum: Ferret Example on how to boost a field?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Edoardo M. (Guest)
on 2006-01-30 02:04
I am wondering whether one could boost certain fields (e.g., title and
keywords) to make them 'weigh' more against searches across all fields.

I know that Document::Field has a boost attribute and that it accepts a
boost argument in the constructor (although I've had not much luck with
it, I am just getting back exceptions upon init w/ boost), but I was
wondering whether the boost parameter could be set on the index or
search and not at indexing time on the doc field. Moreover, I see that
the default is set to 1.0 but what's the max? What are reasonable values
for the boost parameter. How would boosting up to 1.1 or 10 or 100
affect the search results?

Thank you in advance for your consideration,

David B. (Guest)
on 2006-01-30 09:58
(Received via mailing list)
Hi Dado,

Could you give an example of your code that is causing exceptions?

If you want to see the effect that a boost has on the results you can
use IndexSearcher#explain(query, doc) to see how the boost effects the
query score. There is no maximum or minimum value for the boost.

Hope that helps,
This topic is locked and can not be replied to.