asuka
asuka

Reputation: 2439

Terms Prevalence in SolR searches

Is there a way to specify a set of terms that are more important when performing a search?

For example, in the following question:

"This morning my printer ran out of paper"

Terms such as "printer" or "paper" are far more important than the rest, and I don't know if there is a way to list these terms to indicate that, in the global knowledge, they'd have more weight than the rest of words.

Upvotes: 0

Views: 100

Answers (2)

Ruwantha
Ruwantha

Reputation: 2653

When you build the query you can define what are the values and how much these fields have weight on the search. This can be done in many ways:

  1. Setting the boost

    The boost can be set by using "^ "

  2. Using plus operator If you define + operator in your query, if there is a exact result for that filed value it is shown in the result.

For a better understanding of solr, it is best to get familiar with lucene query syntax. Refer to this link to get more info.

Upvotes: 0

Marko Bonaci
Marko Bonaci

Reputation: 5708

For specific documents you can use QueryElevationComponent, which uses special XML file in which you place your specific terms for which you want specific doc ids. Not exactly what you need, I know.

And regarding your comment about users not caring what's underneath, you control the final query. Or, in the worst case, you can modify it after you receive it at Solr server side.

Similar: Lucene term boosting with sunspot-rails

Upvotes: 1

Related Questions