Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
35 lines (21 sloc) 1.42 KB

Indexes: Boosting

A that RavenDB leverages from Lucene is called Boosting. This feature gives you the ability to manually tune the relevance level of matching documents when performing a query.

From the index perspective we can associate to an index entry a boosting factor. The higher value it has, the more relevant term will be. To do this, we must use the Boost method.

Let's jump straight into the example. To perform the query that will return employees where either FirstName or LastName is equal to Bob, and to promote employees (move them to the top of the results) where FirstName matches the phrase, we must first create an index with boosted entry.

{CODE-TABS} {CODE-TAB:java:AbstractIndexCreationTask boosting_2@Indexes\ /} {CODE-TAB:java:Operation boosting_4@Indexes\ /} {CODE-TABS/}

The next step is to perform a query against that index:

{CODE:java boosting_3@Indexes\ /}


{INFO Boosting is also available at the query level. You can read more about it here. /}

Related Articles



You can’t perform that action at this time.