Class: Solr::Query::Request::Boosting::GeodistFunction
- Inherits:
-
Object
- Object
- Solr::Query::Request::Boosting::GeodistFunction
- Includes:
- Support::SchemaHelper
- Defined in:
- lib/solr/query/request/boosting/geodist_function.rb
Instance Attribute Summary collapse
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#latitude ⇒ Object
readonly
Returns the value of attribute latitude.
-
#longitude ⇒ Object
readonly
Returns the value of attribute longitude.
Instance Method Summary collapse
-
#initialize(field:, latitude:, longitude:) ⇒ GeodistFunction
constructor
A new instance of GeodistFunction.
-
#latlng ⇒ Object
TODO: Check this dead code and the initialize arguments.
- #sfield ⇒ Object
- #to_solr_s ⇒ Object
Methods included from Support::SchemaHelper
Constructor Details
#initialize(field:, latitude:, longitude:) ⇒ GeodistFunction
Returns a new instance of GeodistFunction.
13 14 15 16 17 18 |
# File 'lib/solr/query/request/boosting/geodist_function.rb', line 13 def initialize(field:, latitude:, longitude:) @field = field @latitude = latitude @longitude = longitude freeze end |
Instance Attribute Details
#field ⇒ Object (readonly)
Returns the value of attribute field.
11 12 13 |
# File 'lib/solr/query/request/boosting/geodist_function.rb', line 11 def field @field end |
#latitude ⇒ Object (readonly)
Returns the value of attribute latitude.
11 12 13 |
# File 'lib/solr/query/request/boosting/geodist_function.rb', line 11 def latitude @latitude end |
#longitude ⇒ Object (readonly)
Returns the value of attribute longitude.
11 12 13 |
# File 'lib/solr/query/request/boosting/geodist_function.rb', line 11 def longitude @longitude end |
Instance Method Details
#latlng ⇒ Object
TODO: Check this dead code and the initialize arguments
26 27 28 |
# File 'lib/solr/query/request/boosting/geodist_function.rb', line 26 def latlng "#{latitude},#{longitude}" end |
#sfield ⇒ Object
30 31 32 |
# File 'lib/solr/query/request/boosting/geodist_function.rb', line 30 def sfield solarize_field(field) end |
#to_solr_s ⇒ Object
20 21 22 23 |
# File 'lib/solr/query/request/boosting/geodist_function.rb', line 20 def to_solr_s # this constants are magical, but they influence the slope of geo proximity decay function 'recip(geodist(),3,17000,3000)' end |