Class: Daedal::Queries::FunctionScoreQuery

Inherits:
Query
  • Object
show all
Defined in:
lib/daedal/queries/function_score_query.rb

Instance Method Summary collapse

Methods inherited from Query

#to_json

Instance Method Details

#to_hashObject



15
16
17
18
19
20
21
22
23
24
# File 'lib/daedal/queries/function_score_query.rb', line 15

def to_hash
  {
    function_score: {
      query: build_query,
      functions: score_functions.map { |f| { filter: f[:filter].to_hash, weight: f[:weight] } },
      boost: boost || 1,
      score_mode: score_mode || "multiply"
    }
  }
end