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

Inherits:
Object
  • Object
show all
Includes:
Support::SchemaHelper
Defined in:
lib/solr/query/request/boosting/scale_function_boost.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Support::SchemaHelper

#solarize_field

Constructor Details

#initialize(field:, min:, max:) ⇒ ScaleFunctionBoost

Returns a new instance of ScaleFunctionBoost.



10
11
12
13
14
15
# File 'lib/solr/query/request/boosting/scale_function_boost.rb', line 10

def initialize(field:, min:, max:)
  @field = field
  @min = min
  @max = max
  freeze
end

Instance Attribute Details

#fieldObject (readonly)

Returns the value of attribute field.



8
9
10
# File 'lib/solr/query/request/boosting/scale_function_boost.rb', line 8

def field
  @field
end

#maxObject (readonly)

Returns the value of attribute max.



8
9
10
# File 'lib/solr/query/request/boosting/scale_function_boost.rb', line 8

def max
  @max
end

#minObject (readonly)

Returns the value of attribute min.



8
9
10
# File 'lib/solr/query/request/boosting/scale_function_boost.rb', line 8

def min
  @min
end

Instance Method Details

#solr_fieldObject



21
22
23
# File 'lib/solr/query/request/boosting/scale_function_boost.rb', line 21

def solr_field
  solarize_field(field)
end

#to_solr_sObject



17
18
19
# File 'lib/solr/query/request/boosting/scale_function_boost.rb', line 17

def to_solr_s
  "scale(#{solr_field},#{min},#{max})"
end