Class: Elasticsearch::API::Response::ExplainNode
- Inherits:
-
Object
- Object
- Elasticsearch::API::Response::ExplainNode
show all
- Extended by:
- Forwardable
- Includes:
- Renderable
- Defined in:
- lib/elasticsearch/api/response/explain_node.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from Renderable
#render, #render_as_hash, #render_in_line
Constructor Details
#initialize(score:, description:, details: [], level: 0) ⇒ ExplainNode
15
16
17
18
19
20
21
|
# File 'lib/elasticsearch/api/response/explain_node.rb', line 15
def initialize(score:, description:, details: [], level: 0)
@score = score
@description = description
@details = details
@level = level
@children = []
end
|
Instance Attribute Details
#children ⇒ Object
Returns the value of attribute children.
11
12
13
|
# File 'lib/elasticsearch/api/response/explain_node.rb', line 11
def children
@children
end
|
#description ⇒ Object
Returns the value of attribute description.
10
11
12
|
# File 'lib/elasticsearch/api/response/explain_node.rb', line 10
def description
@description
end
|
#details ⇒ Object
Returns the value of attribute details.
10
11
12
|
# File 'lib/elasticsearch/api/response/explain_node.rb', line 10
def details
@details
end
|
#level ⇒ Object
Returns the value of attribute level.
10
11
12
|
# File 'lib/elasticsearch/api/response/explain_node.rb', line 10
def level
@level
end
|
#score ⇒ Object
Returns the value of attribute score.
10
11
12
|
# File 'lib/elasticsearch/api/response/explain_node.rb', line 10
def score
@score
end
|
Instance Method Details
#as_json ⇒ Object
67
68
69
|
# File 'lib/elasticsearch/api/response/explain_node.rb', line 67
def as_json
{ score: score }.merge(description.as_json)
end
|
#boost? ⇒ Boolean
43
44
45
|
# File 'lib/elasticsearch/api/response/explain_node.rb', line 43
def boost?
type == "boost"
end
|
#func? ⇒ Boolean
31
32
33
|
# File 'lib/elasticsearch/api/response/explain_node.rb', line 31
def func?
type == "func"
end
|
#func_score? ⇒ Boolean
51
52
53
|
# File 'lib/elasticsearch/api/response/explain_node.rb', line 51
def func_score?
type == "func score"
end
|
#has_children? ⇒ Boolean
63
64
65
|
# File 'lib/elasticsearch/api/response/explain_node.rb', line 63
def has_children?
children.any?
end
|
#match? ⇒ Boolean
35
36
37
|
# File 'lib/elasticsearch/api/response/explain_node.rb', line 35
def match?
type == "match"
end
|
#match_all? ⇒ Boolean
39
40
41
|
# File 'lib/elasticsearch/api/response/explain_node.rb', line 39
def match_all?
type == "match" && field == "*" && value == "*"
end
|
#max_boost? ⇒ Boolean
47
48
49
|
# File 'lib/elasticsearch/api/response/explain_node.rb', line 47
def max_boost?
type == "maxBoost"
end
|
#min? ⇒ Boolean
27
28
29
|
# File 'lib/elasticsearch/api/response/explain_node.rb', line 27
def min?
type == "min"
end
|
#query_boost? ⇒ Boolean
55
56
57
|
# File 'lib/elasticsearch/api/response/explain_node.rb', line 55
def query_boost?
type == "queryBoost"
end
|
#score_one? ⇒ Boolean
23
24
25
|
# File 'lib/elasticsearch/api/response/explain_node.rb', line 23
def score_one?
score == 1.0
end
|
#script? ⇒ Boolean
59
60
61
|
# File 'lib/elasticsearch/api/response/explain_node.rb', line 59
def script?
type == "script"
end
|