Class: Queries::NestedSortQueryBuilder
- Inherits:
-
QueryBuilder
- Object
- QueryBuilder
- Queries::NestedSortQueryBuilder
- Defined in:
- lib/queries/nested_sort_query_builder.rb
Constant Summary collapse
- NAME =
"nested"
Instance Attribute Summary collapse
-
#inner_query ⇒ Object
readonly
Returns the value of attribute inner_query.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(path:, inner_query:) ⇒ NestedSortQueryBuilder
constructor
@params: path: The query path points to the nested object path.
-
#inner_query_expr ⇒ Object
returns inner_query.
-
#path_expr ⇒ Object
returns path.
- #query ⇒ Object
-
#score_mode_expr ⇒ Object
returns score_mode.
Methods inherited from QueryBuilder
Methods included from AttributesReader
Methods included from AbstractQueryBuilder
Constructor Details
#initialize(path:, inner_query:) ⇒ NestedSortQueryBuilder
@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)
16 17 18 19 |
# File 'lib/queries/nested_sort_query_builder.rb', line 16 def initialize path:, inner_query: @path = path @inner_query = inner_query end |
Instance Attribute Details
#inner_query ⇒ Object (readonly)
Returns the value of attribute inner_query.
7 8 9 |
# File 'lib/queries/nested_sort_query_builder.rb', line 7 def inner_query @inner_query end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
7 8 9 |
# File 'lib/queries/nested_sort_query_builder.rb', line 7 def path @path end |
Instance Method Details
#inner_query_expr ⇒ Object
returns inner_query
34 35 36 |
# File 'lib/queries/nested_sort_query_builder.rb', line 34 def inner_query_expr return @inner_query end |
#path_expr ⇒ Object
returns path
29 30 31 |
# File 'lib/queries/nested_sort_query_builder.rb', line 29 def path_expr return @path end |
#query ⇒ Object
21 22 23 24 25 26 |
# 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 ⇒ Object
returns score_mode
39 40 41 |
# File 'lib/queries/nested_sort_query_builder.rb', line 39 def score_mode_expr return @score_mode end |