Skip to content

Commit 223ddf6

Browse files
Improve documentation and comments around index narrowing.
Generated with Claude Code
1 parent bddd087 commit 223ddf6

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

elasticgraph-graphql/lib/elastic_graph/graphql/datastore_query.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ class GraphQL
2828
# with minimal effort.
2929
class DatastoreQuery < Support::MemoizableData.define(
3030
:total_document_count_needed, :aggregations, :logger, :filter_interpreter, :routing_picker,
31-
:typename_filter, :index_definitions_by_type_name,
3231
:index_expression_builder, :default_page_size, :initial_search_index_definitions, :max_page_size,
32+
:typename_filter, :index_definitions_by_type_name,
3333
:client_filters, :internal_filters, :sort, :document_pagination,
3434
:requested_fields, :request_all_fields, :requested_highlights, :request_all_highlights,
3535
:individual_docs_needed, :size_multiplier, :monotonic_clock_deadline, :schema_element_names
@@ -140,6 +140,9 @@ def to_datastore_msearch_header_and_body
140140
@to_datastore_msearch_header_and_body ||= [to_datastore_msearch_header, to_datastore_body]
141141
end
142142

143+
# @!attribute [r] initial_search_index_definitions
144+
# The index definitions provided at construction time, before any `__typename`-based narrowing.
145+
143146
# Returns the narrowed set of index definitions to search, based on any `__typename` filter
144147
# in the client filters. Falls back to `initial_search_index_definitions` when there is no
145148
# `__typename` filter or no type name mapping is available.

elasticgraph-graphql/lib/elastic_graph/graphql/datastore_query/index_expression_builder.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def +(other)
141141
# `Query::IndexExpressionBuilder` exists only for use by `Query` and is effectively private.
142142
private_constant :IndexExpressionBuilder
143143

144-
# Steep is complaining that it can't find some `Query` but they are not in this file...
144+
# Steep can't find implementations of these `DatastoreQuery` methods because they're defined in `datastore_query.rb`, not in this file.
145145
# @dynamic shard_routing_values, effective_size, merge_with, search_index_expression, narrowed_search_index_definitions, with, to_datastore_msearch_header_and_body
146146
end
147147
end

elasticgraph-graphql/lib/elastic_graph/graphql/datastore_query/routing_picker.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def extract_eligible_routing_values(filter_hashes, routing_field_paths)
5353
# `Query::RoutingPicker` exists only for use by `Query` and is effectively private.
5454
private_constant :RoutingPicker
5555

56-
# Steep is complaining that it can't find some `Query` but they are not in this file...
56+
# Steep can't find implementations of these `DatastoreQuery` methods because they're defined in `datastore_query.rb`, not in this file.
5757
# @dynamic shard_routing_values, effective_size, merge_with, search_index_expression, narrowed_search_index_definitions, with, to_datastore_msearch_header_and_body
5858
end
5959
end

0 commit comments

Comments
 (0)