jay_api 29.1.0 → 29.3.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: 1f1153d9c1260eec0e2b267dbf5ea63074c388f5a72ee4473013322e380388aa
4
- data.tar.gz: 3e329829a95831222b1d5111de202b1d0a4160b22889f549e81bde8f4c072b10
3
+ metadata.gz: 4ac3a59adff18d4cdc931309dc9467f3e528cc667b6796dcf7385e53c9d7022e
4
+ data.tar.gz: 39b30584e5685d1147640675b9026f7fe6e5493cc28b78c314b17247af7a2c3d
5
5
  SHA512:
6
- metadata.gz: 87460d91ba4fcee072ce01d7b4d9a71d926cf6c1d6a02aa5cb1d8fda8e6ed1e09d510de9e411d980594ee22991a420abf784c60eface6e9d9fa51f1e9563ddf1
7
- data.tar.gz: 6e64661a3fe9cd20cb9f437e3310d5ccd6ac85d8931a681d571224bec564a51c738a7a198d054b40c8effa2af2514423f64985acdcad8994d2ee89f98df047b6
6
+ metadata.gz: 40f8ec6e0622d1e8b577f20b8dd8b1bb9027b36ec3a262f2948702534b3cb2a69fa606db72d7eee920e111747138fdc1562b17325a2821e662f732d90cecb456
7
+ data.tar.gz: cf1b914bd5e2115b43671e0f7d53ab50228c6e8151ce16cca5339e80f26975dfda72c0fce4558192187611eb1c5979f38e0290bdb9741585f364edb0c3250e5a
data/CHANGELOG.md CHANGED
@@ -8,6 +8,20 @@ Please mark backwards incompatible changes with an exclamation mark at the start
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [29.3.0] - 2025-12-11
12
+
13
+ ### Added
14
+ - The `timeout` parameter to `Elasticsearch::ClientFactory#create`. The parameter
15
+ allows the user to specify the timeout in seconds for Elasticsearch requests.
16
+
17
+ ## [29.2.0] - 2025-12-09
18
+
19
+ ### Added
20
+ - A `#clone` method to `Elasticsearch::QueryBuilder` that properly clones the
21
+ `QueryBuilder` and its nested objects.
22
+ - ActiveSupport's `#present?`, `#presence` and `#blank?` methods can now be used
23
+ in ERB configuration files.
24
+
11
25
  ## [29.1.0] - 2025-10-22
12
26
 
13
27
  ### Added
@@ -3,6 +3,7 @@
3
3
  require 'active_support'
4
4
  require 'active_support/core_ext/hash/keys'
5
5
  require 'active_support/core_ext/hash/indifferent_access'
6
+ require 'active_support/core_ext/object/blank'
6
7
 
7
8
  require 'erb'
8
9
  require 'forwardable'
@@ -62,13 +62,17 @@ module JayAPI
62
62
  # each connection will be:
63
63
  # * wait_interval with :constant wait strategy
64
64
  # * wait_interval**i with :geometric wait strategy (where i is the i'th re-try)
65
+ # @param [Integer] timeout The number of seconds to wait for Elasticsearch's
66
+ # response. For big queries that fetch large amounts of data the default
67
+ # timeout may be too low.
65
68
  # @return [JayAPI::Elasticsearch::Client] The Elasticsearch client.
66
- def create(max_attempts: MAX_ATTEMPTS, wait_strategy: :geometric, wait_interval: WAIT_INTERVAL)
69
+ def create(max_attempts: MAX_ATTEMPTS, wait_strategy: :geometric, wait_interval: WAIT_INTERVAL, timeout: nil)
67
70
  JayAPI::Elasticsearch::Client.new(
68
- ::Elasticsearch::Client.new(
71
+ ::Elasticsearch::Client.new({
69
72
  hosts: [host],
70
- log: false
71
- ),
73
+ log: false,
74
+ request_timeout: timeout
75
+ }.compact),
72
76
  logger,
73
77
  max_attempts: max_attempts,
74
78
  wait_strategy: WAIT_STRATEGIES[wait_strategy].new(wait_interval: wait_interval, logger: logger)
@@ -127,6 +127,16 @@ module JayAPI
127
127
  )
128
128
  end
129
129
 
130
+ # @return [JayAPI::Elasticsearch::QueryBuilder] A copy of the receiver.
131
+ def clone
132
+ copy = super
133
+ copy.source = @source.clone # source can be an Array or a Hash
134
+ copy.sort = @sort.clone # sort is a Hash
135
+ copy.query = query.clone
136
+ copy.aggregations = aggregations.clone
137
+ copy
138
+ end
139
+
130
140
  protected
131
141
 
132
142
  attr_writer :from, :size, :source, :collapse, :sort, :query, :aggregations
@@ -2,5 +2,5 @@
2
2
 
3
3
  module JayAPI
4
4
  # JayAPI gem's semantic version
5
- VERSION = '29.1.0'
5
+ VERSION = '29.3.0'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jay_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 29.1.0
4
+ version: 29.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Accenture-Industry X
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2025-10-22 00:00:00.000000000 Z
12
+ date: 2025-12-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport