Improved Boosting with “all” Property
Well, I just finished implementing a really cool feature in Compass supporting specific boosting for terms in the all property. This is best shown with an example:
1 2 3 4 5 6 7 8 9 | @Searchable public class Article { @SearchableProperty(boost = 5.0f) String title; @SearchableProperty String content; } |
In this case we mark the title to be more “important” than content. This means that if Article a title has the token london, and Article b content has a token london, then if we do the following search: title:london OR content:london, a will rank higher than b.
This is really nice, but, when searching, people usually search on the all field of Compass. The all field in Compass is a special field that actually allows to search on all the different fields of Article (its performance has much improved in 2.0). The main problem with the all field (up until now) is the fact that it did not take boosting into account. Well, now it does :).
What does it means? If we take current Compass versions (without the new all boost feature), if we search for london, a Article and b Article will rank the same. Now, with the new all boost feature, a will rank much higher than b.
This feature is available in Compass 2.0 M3. Take the nightlies for a spin.
February 21st, 2008 at 3:22 pm
Sounds good! Nice work :-)
March 19th, 2008 at 1:35 pm
[…] 2.0.0 M3 has just been released. This release includes several major features, among them are: boosting with all property, spell check support as well as many bug fixes and improvements. For a complete list, please check […]