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.



My name is Shay Banon, the founder of 
Sounds good! Nice work :-)