class Queries::NestedSortQueryBuilder

Constants

NAME

Attributes

inner_query[R]
path[R]

Public Class Methods

new(path:, inner_query: @path = path) click to toggle source

@params:

path: The query path points to the nested object path.
inner_query: query includes the query that will run on the nested docs matching the direct path, and joining with the root parent docs

Any fields referenced inside the query must use the complete path (fully qualified)

# File lib/queries/nested_sort_query_builder.rb, line 16
def initialize path:, inner_query:
  @path = path
  @inner_query = inner_query
end

Public Instance Methods

inner_query_expr() click to toggle source

returns inner_query

# File lib/queries/nested_sort_query_builder.rb, line 34
def inner_query_expr
  return @inner_query
end
path_expr() click to toggle source

returns path

# File lib/queries/nested_sort_query_builder.rb, line 29
def path_expr
  return @path
end
query() click to toggle source
# File lib/queries/nested_sort_query_builder.rb, line 21
def query
  nested_query = self.common_query
  nested_query[:path] = @path if @path.present?
  nested_query[:filter] = @inner_query.query if @inner_query.present?
  return nested_query
end
score_mode_expr() click to toggle source

returns score_mode

# File lib/queries/nested_sort_query_builder.rb, line 39
def score_mode_expr
  return @score_mode
end