elasticgraph-datastore_core 0.19.1.1 → 0.19.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: abd3133bbb06f22b0430b5097470a590a05995466c6aeebdd69e56e62e441622
4
- data.tar.gz: 3ca9507dd0bb9482467cfcebd2d0a2a0dfe4dcb31680ad3ff62c451d0220584d
3
+ metadata.gz: 4d980ddcf89e7f69f05f820ba9afe2e5a217e3a59616b9e296780e4631c0d722
4
+ data.tar.gz: c08be512eb14680d0dcc4609864c3161922afe85f18885fa41bb6c6ed8be3c3b
5
5
  SHA512:
6
- metadata.gz: 58e6f8a7cc9410c86399b9446250bbbedf87b21e19745744141cc13f3e087baa83b9e6f600c9fd5a2b69106ef6de721104d3f31b8f7c4ed414e9b757a404f73d
7
- data.tar.gz: 798e194f565cd3471545066a024a23a00ae458705cb48774581fea7efb2765cf89f154a58f7e9cfd23d06435645f38554ad72a9a81328482ca10a1b2da254032
6
+ metadata.gz: a0b8e56ca350f439753bd176ed0091fe2c426463fb7725633326ed98287c47516aabc898f35a58e0932301ce5c13034da36d9e430cc2ee3a971bcb8b7a1a8021
7
+ data.tar.gz: fb1a17ccf071e7ec11b7cdf28bd43a27911189b0572197cc442037fc70dbf990eb3ffb26b261ded6cb5c8c9f8579f0e6eaf1f3db2d91113740c42f2f8f57e9b6
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2024 Block, Inc.
3
+ Copyright (c) 2024 - 2025 Block, Inc.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,4 +1,4 @@
1
- # Copyright 2024 Block, Inc.
1
+ # Copyright 2024 - 2025 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 Block, Inc.
1
+ # Copyright 2024 - 2025 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 Block, Inc.
1
+ # Copyright 2024 - 2025 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 Block, Inc.
1
+ # Copyright 2024 - 2025 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 Block, Inc.
1
+ # Copyright 2024 - 2025 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 Block, Inc.
1
+ # Copyright 2024 - 2025 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -36,16 +36,22 @@ module ElasticGraph
36
36
  raise Errors::ConfigError, "`#{self}` uses custom routing, but `route_with_path` is misconfigured (was `nil`)"
37
37
  end
38
38
 
39
- config_routing_value = Support::HashUtil.fetch_value_at_path(prepared_record, route_with_path).to_s
39
+ config_routing_value = Support::HashUtil.fetch_value_at_path(prepared_record, route_with_path.split(".")).to_s
40
40
  return config_routing_value unless ignored_values_for_routing.include?(config_routing_value)
41
41
 
42
- Support::HashUtil.fetch_value_at_path(prepared_record, id_path).to_s
42
+ Support::HashUtil.fetch_value_at_path(prepared_record, id_path.split(".")).to_s
43
43
  end
44
44
 
45
45
  def has_custom_routing?
46
46
  route_with != "id"
47
47
  end
48
48
 
49
+ def max_result_window
50
+ @max_result_window ||= flattened_env_setting_overrides.fetch("index.max_result_window") do
51
+ env_agnostic_settings.fetch("index.max_result_window")
52
+ end
53
+ end
54
+
49
55
  # Indicates if a search on this index definition may hit incomplete documents. An incomplete document
50
56
  # can occur when multiple event types flow into the same index. An index that has only one source type
51
57
  # can never have incomplete documents, but an index that has 2 or more sources can have incomplete
@@ -1,4 +1,4 @@
1
- # Copyright 2024 Block, Inc.
1
+ # Copyright 2024 - 2025 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -15,15 +15,16 @@ module ElasticGraph
15
15
  module IndexDefinition
16
16
  class Index < Support::MemoizableData.define(
17
17
  :name, :route_with, :default_sort_clauses, :current_sources, :fields_by_path,
18
- :env_index_config, :defined_clusters, :datastore_clients_by_name
18
+ :env_index_config, :defined_clusters, :datastore_clients_by_name, :env_agnostic_settings
19
19
  )
20
20
  # `Data.define` provides all these methods:
21
- # @dynamic name, route_with, default_sort_clauses, current_sources, fields_by_path, env_index_config, defined_clusters, datastore_clients_by_name, initialize
21
+ # @dynamic name, route_with, default_sort_clauses, current_sources, fields_by_path, env_index_config, env_agnostic_settings
22
+ # @dynamic defined_clusters, datastore_clients_by_name, initialize,
22
23
 
23
24
  # `include IndexDefinition::Base` provides all these methods. Steep should be able to detect it
24
25
  # but can't for some reason so we have to declare them with `@dynamic`.
25
26
  # @dynamic flattened_env_setting_overrides, routing_value_for_prepared_record, has_custom_routing?, cluster_to_query, use_updates_for_indexing?
26
- # @dynamic clusters_to_index_into, all_accessible_cluster_names, ignored_values_for_routing, searches_could_hit_incomplete_docs?
27
+ # @dynamic clusters_to_index_into, all_accessible_cluster_names, ignored_values_for_routing, searches_could_hit_incomplete_docs?, max_result_window
27
28
  # @dynamic accessible_cluster_names_to_index_into, accessible_from_queries?, known_related_query_rollover_indices, list_counts_field_paths_for_source
28
29
  include IndexDefinition::Base
29
30
 
@@ -1,4 +1,4 @@
1
- # Copyright 2024 Block, Inc.
1
+ # Copyright 2024 - 2025 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 Block, Inc.
1
+ # Copyright 2024 - 2025 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -22,16 +22,17 @@ module ElasticGraph
22
22
  module IndexDefinition
23
23
  class RolloverIndexTemplate < Support::MemoizableData.define(
24
24
  :name, :route_with, :default_sort_clauses, :current_sources, :fields_by_path, :env_index_config,
25
- :index_args, :defined_clusters, :datastore_clients_by_name, :timestamp_field_path, :frequency
25
+ :index_args, :defined_clusters, :datastore_clients_by_name, :timestamp_field_path, :frequency,
26
+ :env_agnostic_settings
26
27
  )
27
28
  # `Data.define` provides all these methods:
28
- # @dynamic name, route_with, default_sort_clauses, current_sources, fields_by_path, env_index_config,
29
+ # @dynamic name, route_with, default_sort_clauses, current_sources, fields_by_path, env_index_config, env_agnostic_settings
29
30
  # @dynamic index_args, defined_clusters, datastore_clients_by_name, timestamp_field_path, frequency, initialize
30
31
 
31
32
  # `include IndexDefinition::Base` provides all these methods. Steep should be able to detect it
32
33
  # but can't for some reason so we have to declare them with `@dynamic`.
33
34
  # @dynamic flattened_env_setting_overrides, routing_value_for_prepared_record, has_custom_routing?, cluster_to_query, use_updates_for_indexing?
34
- # @dynamic clusters_to_index_into, all_accessible_cluster_names, ignored_values_for_routing, searches_could_hit_incomplete_docs?
35
+ # @dynamic clusters_to_index_into, all_accessible_cluster_names, ignored_values_for_routing, searches_could_hit_incomplete_docs?, max_result_window
35
36
  # @dynamic accessible_cluster_names_to_index_into, accessible_from_queries?, known_related_query_rollover_indices, list_counts_field_paths_for_source
36
37
  include IndexDefinition::Base
37
38
 
@@ -178,7 +179,7 @@ module ElasticGraph
178
179
 
179
180
  def rollover_index_suffix_for_record(record, timestamp_field_path:)
180
181
  timestamp_value = ::DateTime.iso8601(
181
- Support::HashUtil.fetch_value_at_path(record, timestamp_field_path)
182
+ Support::HashUtil.fetch_value_at_path(record, timestamp_field_path.split("."))
182
183
  ).to_time
183
184
 
184
185
  if (matching_custom_range = env_index_config.custom_timestamp_range_for(timestamp_value))
@@ -1,4 +1,4 @@
1
- # Copyright 2024 Block, Inc.
1
+ # Copyright 2024 - 2025 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -18,7 +18,7 @@ module ElasticGraph
18
18
  # This module contains common implementation logic for both the rollover and non-rollover
19
19
  # case, as well as a `with` factory method.
20
20
  module IndexDefinition
21
- def self.with(name:, runtime_metadata:, config:, datastore_clients_by_name:)
21
+ def self.with(name:, runtime_metadata:, config:, datastore_clients_by_name:, schema_artifacts:)
22
22
  if (env_index_config = config.index_definitions[name]).nil?
23
23
  raise Errors::ConfigError, "Configuration does not provide an index definition for `#{name}`, " \
24
24
  "but it is required so we can identify the datastore cluster(s) to query and index into."
@@ -36,14 +36,20 @@ module ElasticGraph
36
36
  }
37
37
 
38
38
  if (rollover = runtime_metadata.rollover)
39
+ env_agnostic_settings = schema_artifacts.index_templates.fetch(name).fetch("template").fetch("settings")
40
+
39
41
  RolloverIndexTemplate.new(
42
+ env_agnostic_settings: env_agnostic_settings,
40
43
  timestamp_field_path: rollover.timestamp_field_path,
41
44
  frequency: rollover.frequency,
42
- index_args: common_args,
45
+ index_args: common_args.merge(env_agnostic_settings: env_agnostic_settings),
43
46
  **common_args
44
47
  )
45
48
  else
46
- Index.new(**common_args)
49
+ Index.new(
50
+ env_agnostic_settings: schema_artifacts.indices.fetch(name).fetch("settings"),
51
+ **common_args
52
+ )
47
53
  end
48
54
  end
49
55
  end
@@ -1,4 +1,4 @@
1
- # Copyright 2024 Block, Inc.
1
+ # Copyright 2024 - 2025 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -49,7 +49,8 @@ module ElasticGraph
49
49
  name: name,
50
50
  runtime_metadata: index_def_metadata,
51
51
  config: config,
52
- datastore_clients_by_name: clients_by_name
52
+ datastore_clients_by_name: clients_by_name,
53
+ schema_artifacts: schema_artifacts
53
54
  )
54
55
 
55
56
  [name, index_def]
metadata CHANGED
@@ -1,16 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elasticgraph-datastore_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.1.1
4
+ version: 0.19.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Myron Marston
8
8
  - Ben VandenBos
9
9
  - Block Engineering
10
- autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2025-02-07 00:00:00.000000000 Z
12
+ date: 2025-04-09 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: elasticgraph-schema_artifacts
@@ -18,85 +17,84 @@ dependencies:
18
17
  requirements:
19
18
  - - '='
20
19
  - !ruby/object:Gem::Version
21
- version: 0.19.1.1
20
+ version: 0.19.2.0
22
21
  type: :runtime
23
22
  prerelease: false
24
23
  version_requirements: !ruby/object:Gem::Requirement
25
24
  requirements:
26
25
  - - '='
27
26
  - !ruby/object:Gem::Version
28
- version: 0.19.1.1
27
+ version: 0.19.2.0
29
28
  - !ruby/object:Gem::Dependency
30
29
  name: elasticgraph-support
31
30
  requirement: !ruby/object:Gem::Requirement
32
31
  requirements:
33
32
  - - '='
34
33
  - !ruby/object:Gem::Version
35
- version: 0.19.1.1
34
+ version: 0.19.2.0
36
35
  type: :runtime
37
36
  prerelease: false
38
37
  version_requirements: !ruby/object:Gem::Requirement
39
38
  requirements:
40
39
  - - '='
41
40
  - !ruby/object:Gem::Version
42
- version: 0.19.1.1
41
+ version: 0.19.2.0
43
42
  - !ruby/object:Gem::Dependency
44
43
  name: elasticgraph-admin
45
44
  requirement: !ruby/object:Gem::Requirement
46
45
  requirements:
47
46
  - - '='
48
47
  - !ruby/object:Gem::Version
49
- version: 0.19.1.1
48
+ version: 0.19.2.0
50
49
  type: :development
51
50
  prerelease: false
52
51
  version_requirements: !ruby/object:Gem::Requirement
53
52
  requirements:
54
53
  - - '='
55
54
  - !ruby/object:Gem::Version
56
- version: 0.19.1.1
55
+ version: 0.19.2.0
57
56
  - !ruby/object:Gem::Dependency
58
57
  name: elasticgraph-elasticsearch
59
58
  requirement: !ruby/object:Gem::Requirement
60
59
  requirements:
61
60
  - - '='
62
61
  - !ruby/object:Gem::Version
63
- version: 0.19.1.1
62
+ version: 0.19.2.0
64
63
  type: :development
65
64
  prerelease: false
66
65
  version_requirements: !ruby/object:Gem::Requirement
67
66
  requirements:
68
67
  - - '='
69
68
  - !ruby/object:Gem::Version
70
- version: 0.19.1.1
69
+ version: 0.19.2.0
71
70
  - !ruby/object:Gem::Dependency
72
71
  name: elasticgraph-opensearch
73
72
  requirement: !ruby/object:Gem::Requirement
74
73
  requirements:
75
74
  - - '='
76
75
  - !ruby/object:Gem::Version
77
- version: 0.19.1.1
76
+ version: 0.19.2.0
78
77
  type: :development
79
78
  prerelease: false
80
79
  version_requirements: !ruby/object:Gem::Requirement
81
80
  requirements:
82
81
  - - '='
83
82
  - !ruby/object:Gem::Version
84
- version: 0.19.1.1
83
+ version: 0.19.2.0
85
84
  - !ruby/object:Gem::Dependency
86
85
  name: elasticgraph-schema_definition
87
86
  requirement: !ruby/object:Gem::Requirement
88
87
  requirements:
89
88
  - - '='
90
89
  - !ruby/object:Gem::Version
91
- version: 0.19.1.1
90
+ version: 0.19.2.0
92
91
  type: :development
93
92
  prerelease: false
94
93
  version_requirements: !ruby/object:Gem::Requirement
95
94
  requirements:
96
95
  - - '='
97
96
  - !ruby/object:Gem::Version
98
- version: 0.19.1.1
99
- description:
97
+ version: 0.19.2.0
100
98
  email:
101
99
  - myron@squareup.com
102
100
  executables: []
@@ -121,12 +119,11 @@ licenses:
121
119
  - MIT
122
120
  metadata:
123
121
  bug_tracker_uri: https://github.com/block/elasticgraph/issues
124
- changelog_uri: https://github.com/block/elasticgraph/releases/tag/v0.19.1.1
125
- documentation_uri: https://block.github.io/elasticgraph/docs/main/
122
+ changelog_uri: https://github.com/block/elasticgraph/releases/tag/v0.19.2.0
123
+ documentation_uri: https://block.github.io/elasticgraph/api-docs/v0.19.2.0/
126
124
  homepage_uri: https://block.github.io/elasticgraph/
127
- source_code_uri: https://github.com/block/elasticgraph/tree/v0.19.1.1/elasticgraph-datastore_core
125
+ source_code_uri: https://github.com/block/elasticgraph/tree/v0.19.2.0/elasticgraph-datastore_core
128
126
  gem_category: core
129
- post_install_message:
130
127
  rdoc_options: []
131
128
  require_paths:
132
129
  - lib
@@ -144,8 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
141
  - !ruby/object:Gem::Version
145
142
  version: '0'
146
143
  requirements: []
147
- rubygems_version: 3.5.22
148
- signing_key:
144
+ rubygems_version: 3.6.2
149
145
  specification_version: 4
150
146
  summary: ElasticGraph gem containing the core datastore support types and logic.
151
147
  test_files: []