Class: Solr::Query::Request::Boosting::PhraseProximityBoost
- Inherits:
-
Object
- Object
- Solr::Query::Request::Boosting::PhraseProximityBoost
- Includes:
- Support::SchemaHelper
- Defined in:
- lib/solr/query/request/boosting/phrase_proximity_boost.rb
Overview
wiki.apache.org/solr/ExtendedDisMax#pf_.28Phrase_Fields.29 solr in action chapter 16.3.5 we only need to do the phrase proximity boosting if we have a phrase, i.e. more than 1 word
Instance Attribute Summary collapse
-
#boost_magnitude ⇒ Object
readonly
Returns the value of attribute boost_magnitude.
-
#field ⇒ Object
readonly
Returns the value of attribute field.
Instance Method Summary collapse
-
#initialize(field:, boost_magnitude:) ⇒ PhraseProximityBoost
constructor
A new instance of PhraseProximityBoost.
- #to_solr_s ⇒ Object
Methods included from Support::SchemaHelper
Constructor Details
#initialize(field:, boost_magnitude:) ⇒ PhraseProximityBoost
Returns a new instance of PhraseProximityBoost.
13 14 15 16 17 |
# File 'lib/solr/query/request/boosting/phrase_proximity_boost.rb', line 13 def initialize(field:, boost_magnitude:) @field = field @boost_magnitude = boost_magnitude freeze end |
Instance Attribute Details
#boost_magnitude ⇒ Object (readonly)
Returns the value of attribute boost_magnitude.
11 12 13 |
# File 'lib/solr/query/request/boosting/phrase_proximity_boost.rb', line 11 def boost_magnitude @boost_magnitude end |
#field ⇒ Object (readonly)
Returns the value of attribute field.
11 12 13 |
# File 'lib/solr/query/request/boosting/phrase_proximity_boost.rb', line 11 def field @field end |
Instance Method Details
#to_solr_s ⇒ Object
19 20 21 22 |
# File 'lib/solr/query/request/boosting/phrase_proximity_boost.rb', line 19 def to_solr_s solr_field = solarize_field(field) "#{solr_field}^#{boost_magnitude}" end |