We have already seen that the default sort order for search results is by relevance, meaning the degree to which they match the query. If one entity matches on two fields, while another has only one field match, then that first entity is the more relevant result.
Hibernate Search allows us to adjust how relevance is calculated, by boosting the relative importance of entities or fields when they are indexed. These adjustments can be static and fixed, or they can be dynamic and driven by the state of the data at runtime.
Fixed boosting, regardless of the actual data, is as
simple as annotating a class or field with
@Boost. This annotation takes a floating-point parameter for its relative ...