Class: Noiseless::AST::Root

Inherits:
Node
  • Object
show all
Defined in:
lib/noiseless/ast/root.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#to_h

Constructor Details

#initialize(indexes:, bool:, sort:, paginate:, vector: nil, collapse: nil, search_after: nil, aggregations: [], hybrid: nil, pipeline: nil, image_query: nil, conversation: nil, joins: [], remove_duplicates: nil, facet_sample_slope: nil, pinned_hits: nil) ⇒ Root

Returns a new instance of Root.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/noiseless/ast/root.rb', line 10

def initialize(indexes:, bool:, sort:, paginate:, vector: nil, collapse: nil, search_after: nil,
               aggregations: [], hybrid: nil, pipeline: nil, image_query: nil, conversation: nil, joins: [],
               remove_duplicates: nil, facet_sample_slope: nil, pinned_hits: nil)
  super()
  @indexes      = Array(indexes)
  @bool         = bool
  @sort         = sort
  @paginate     = paginate
  @vector       = vector
  @collapse     = collapse
  @search_after = search_after
  @aggregations = aggregations
  @hybrid       = hybrid
  @pipeline     = pipeline
  @image_query  = image_query
  @conversation = conversation
  @joins        = joins
  @remove_duplicates = remove_duplicates
  @facet_sample_slope = facet_sample_slope
  @pinned_hits = pinned_hits
end

Instance Attribute Details

#aggregationsObject (readonly)

Returns the value of attribute aggregations.



6
7
8
# File 'lib/noiseless/ast/root.rb', line 6

def aggregations
  @aggregations
end

#boolObject (readonly)

Returns the value of attribute bool.



6
7
8
# File 'lib/noiseless/ast/root.rb', line 6

def bool
  @bool
end

#collapseObject (readonly)

Returns the value of attribute collapse.



6
7
8
# File 'lib/noiseless/ast/root.rb', line 6

def collapse
  @collapse
end

#conversationObject (readonly)

Returns the value of attribute conversation.



6
7
8
# File 'lib/noiseless/ast/root.rb', line 6

def conversation
  @conversation
end

#facet_sample_slopeObject (readonly)

Returns the value of attribute facet_sample_slope.



6
7
8
# File 'lib/noiseless/ast/root.rb', line 6

def facet_sample_slope
  @facet_sample_slope
end

#hybridObject (readonly)

Returns the value of attribute hybrid.



6
7
8
# File 'lib/noiseless/ast/root.rb', line 6

def hybrid
  @hybrid
end

#image_queryObject (readonly)

Returns the value of attribute image_query.



6
7
8
# File 'lib/noiseless/ast/root.rb', line 6

def image_query
  @image_query
end

#indexesObject (readonly)

Returns the value of attribute indexes.



6
7
8
# File 'lib/noiseless/ast/root.rb', line 6

def indexes
  @indexes
end

#joinsObject (readonly)

Returns the value of attribute joins.



6
7
8
# File 'lib/noiseless/ast/root.rb', line 6

def joins
  @joins
end

#paginateObject (readonly)

Returns the value of attribute paginate.



6
7
8
# File 'lib/noiseless/ast/root.rb', line 6

def paginate
  @paginate
end

#pinned_hitsObject (readonly)

Returns the value of attribute pinned_hits.



6
7
8
# File 'lib/noiseless/ast/root.rb', line 6

def pinned_hits
  @pinned_hits
end

#pipelineObject (readonly)

Returns the value of attribute pipeline.



6
7
8
# File 'lib/noiseless/ast/root.rb', line 6

def pipeline
  @pipeline
end

#remove_duplicatesObject (readonly)

Returns the value of attribute remove_duplicates.



6
7
8
# File 'lib/noiseless/ast/root.rb', line 6

def remove_duplicates
  @remove_duplicates
end

#search_afterObject (readonly)

Returns the value of attribute search_after.



6
7
8
# File 'lib/noiseless/ast/root.rb', line 6

def search_after
  @search_after
end

#sortObject (readonly)

Returns the value of attribute sort.



6
7
8
# File 'lib/noiseless/ast/root.rb', line 6

def sort
  @sort
end

#vectorObject (readonly)

Returns the value of attribute vector.



6
7
8
# File 'lib/noiseless/ast/root.rb', line 6

def vector
  @vector
end

Instance Method Details

#aggregated?Boolean

Returns:

  • (Boolean)


52
53
54
# File 'lib/noiseless/ast/root.rb', line 52

def aggregated?
  @aggregations.any?
end

#collapsed?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'lib/noiseless/ast/root.rb', line 44

def collapsed?
  !@collapse.nil?
end

#conversational?Boolean

Returns:

  • (Boolean)


60
61
62
# File 'lib/noiseless/ast/root.rb', line 60

def conversational?
  !@conversation.nil?
end

#cursor_pagination?Boolean

Returns:

  • (Boolean)


48
49
50
# File 'lib/noiseless/ast/root.rb', line 48

def cursor_pagination?
  !@search_after.nil?
end

#has_joins?Boolean

Returns:

  • (Boolean)


64
65
66
# File 'lib/noiseless/ast/root.rb', line 64

def has_joins?
  @joins.any?
end

#has_pipeline?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/noiseless/ast/root.rb', line 40

def has_pipeline?
  !@pipeline.nil?
end

#hybrid_search?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/noiseless/ast/root.rb', line 36

def hybrid_search?
  !@hybrid.nil?
end

#image_search?Boolean

Returns:

  • (Boolean)


56
57
58
# File 'lib/noiseless/ast/root.rb', line 56

def image_search?
  !@image_query.nil?
end

#vector_search?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/noiseless/ast/root.rb', line 32

def vector_search?
  !@vector.nil?
end