Class: Elasticsearch::API::Response::ExplainNode

Inherits:
Object
  • Object
show all
Defined in:
lib/elasticsearch/api/response/explain_node.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(score:, description:, details: [], level: 0) ⇒ ExplainNode

Returns a new instance of ExplainNode.



8
9
10
11
12
13
14
# File 'lib/elasticsearch/api/response/explain_node.rb', line 8

def initialize(score:, description:, details: [], level: 0)
  @score = score
  @description = description
  @details = details
  @level = level
  @children = []
end

Instance Attribute Details

#childrenObject

Returns the value of attribute children.



6
7
8
# File 'lib/elasticsearch/api/response/explain_node.rb', line 6

def children
  @children
end

#descriptionObject (readonly)

Returns the value of attribute description.



5
6
7
# File 'lib/elasticsearch/api/response/explain_node.rb', line 5

def description
  @description
end

#detailsObject (readonly)

Returns the value of attribute details.



5
6
7
# File 'lib/elasticsearch/api/response/explain_node.rb', line 5

def details
  @details
end

#levelObject (readonly)

Returns the value of attribute level.



5
6
7
# File 'lib/elasticsearch/api/response/explain_node.rb', line 5

def level
  @level
end

#scoreObject (readonly)

Returns the value of attribute score.



5
6
7
# File 'lib/elasticsearch/api/response/explain_node.rb', line 5

def score
  @score
end

Instance Method Details

#boost?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/elasticsearch/api/response/explain_node.rb', line 36

def boost?
  type == "boost"
end

#func?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/elasticsearch/api/response/explain_node.rb', line 24

def func?
  type == "func"
end

#match?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/elasticsearch/api/response/explain_node.rb', line 28

def match?
  type == "match"
end

#match_all?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/elasticsearch/api/response/explain_node.rb', line 32

def match_all?
  type == "match" && description.field == "*" && description.value == "*"
end

#max_boost?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/elasticsearch/api/response/explain_node.rb', line 40

def max_boost?
  type == "maxBoost"
end

#operatorObject



16
17
18
# File 'lib/elasticsearch/api/response/explain_node.rb', line 16

def operator
  description.operator
end

#typeObject



20
21
22
# File 'lib/elasticsearch/api/response/explain_node.rb', line 20

def type
  description.type
end