Class: Solr::Query::Request::Boosting

Inherits:
Object
  • Object
show all
Defined in:
lib/solr/query/request/boosting.rb,
lib/solr/query/request/boosting/geodist_function.rb,
lib/solr/query/request/boosting/ln_function_boost.rb,
lib/solr/query/request/boosting/scale_function_boost.rb,
lib/solr/query/request/boosting/exists_boost_function.rb,
lib/solr/query/request/boosting/phrase_proximity_boost.rb,
lib/solr/query/request/boosting/dictionary_boost_function.rb,
lib/solr/query/request/boosting/ranking_field_boost_function.rb,
lib/solr/query/request/boosting/field_value_match_boost_function.rb,
lib/solr/query/request/boosting/recent_field_value_boost_function.rb,
lib/solr/query/request/boosting/field_value_less_than_boost_function.rb,
lib/solr/query/request/boosting/numeric_field_value_match_boost_function.rb,
lib/solr/query/request/boosting/textual_field_value_match_boost_function.rb

Defined Under Namespace

Classes: DictionaryBoostFunction, ExistsBoostFunction, FieldValueLessThanBoostFunction, FieldValueMatchBoostFunction, GeodistFunction, LnFunctionBoost, NumericFieldValueMatchBoostFunction, PhraseProximityBoost, RankingFieldBoostFunction, RecentFieldValueBoostFunction, ScaleFunctionBoost, TextualFieldValueMatchBoostFunction

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(additive_boost_functions: [], multiplicative_boost_functions: [], phrase_boosts: []) ⇒ Boosting

Returns a new instance of Boosting.



26
27
28
29
30
31
32
# File 'lib/solr/query/request/boosting.rb', line 26

def initialize(additive_boost_functions: [], multiplicative_boost_functions: [], phrase_boosts: [])
  @additive_boost_functions = additive_boost_functions
  @multiplicative_boost_functions = multiplicative_boost_functions
  @phrase_boosts = phrase_boosts
  @spatial_boost = find_spatial_boost
  freeze
end

Instance Attribute Details

#additive_boost_functionsObject (readonly)

Returns the value of attribute additive_boost_functions.



24
25
26
# File 'lib/solr/query/request/boosting.rb', line 24

def additive_boost_functions
  @additive_boost_functions
end

#multiplicative_boost_functionsObject (readonly)

Returns the value of attribute multiplicative_boost_functions.



24
25
26
# File 'lib/solr/query/request/boosting.rb', line 24

def multiplicative_boost_functions
  @multiplicative_boost_functions
end

#phrase_boostsObject (readonly)

Returns the value of attribute phrase_boosts.



24
25
26
# File 'lib/solr/query/request/boosting.rb', line 24

def phrase_boosts
  @phrase_boosts
end

#spatial_boostObject (readonly)

Returns the value of attribute spatial_boost.



24
25
26
# File 'lib/solr/query/request/boosting.rb', line 24

def spatial_boost
  @spatial_boost
end

Class Method Details

.emptyObject



19
20
21
# File 'lib/solr/query/request/boosting.rb', line 19

def empty
  @empty ||= new
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/solr/query/request/boosting.rb', line 34

def empty?
  [multiplicative_boost_functions, additive_boost_functions, phrase_boosts].all(&:empty?)
end