jay_api 29.9.0 → 29.10.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: e0a1faee742a3503bae215225c1a111f9cb21b21e94ffb83b10fcd16d14f71e1
4
- data.tar.gz: b39ed836b7bef2233a3833d9b9e56f5234f4b542fd10f1a4fb7fc35b85e85e37
3
+ metadata.gz: 29f1af4da5bd52cd5012da50bc4933a30cd8d3d7682d4301bab18dfb429d090c
4
+ data.tar.gz: 86924bc855b991f2678cce3d3f023e8958f3beb725fb154429ad5667c705b78c
5
5
  SHA512:
6
- metadata.gz: 4963d63c87ed8d756e94984ec635d53cb4db539e6fba42632be2ecd8f5cf79443485ededadaddf9f15988414db7e37b07b515f2d37529fcc074de8d57bf6f2f4
7
- data.tar.gz: 9db8b8d9600477ded9c07058d26af30de56153717adc5cdd9dc179bd0b2893225936fbdecb2281a0d5e06859ad6797eee3554d89e3531d88d449042040f266d2
6
+ metadata.gz: d4401b8bea8090b4f21182689b336d65256efe4136327c23f1418aa93a88b8bd3d15c364423838b8e29709f2edc4ebae5d99953a8125bd97ae268b4a2fc2de46
7
+ data.tar.gz: ce39feece636e38b932e3b100f814f7ecba3fb3c7c870a6c8a7d12cbba4c24e5c9c32646b6ede2d59f86f73f434b617364b65eaf88a5722582ce9b28c54cc9ad
data/CHANGELOG.md CHANGED
@@ -8,6 +8,15 @@ Please mark backwards incompatible changes with an exclamation mark at the start
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [29.10.0] - 2026-08-21
12
+
13
+ ### Added
14
+ - The `JayAPI::Elasticsearch::QueryBuilder::QueryClauses::Prefix` class and the
15
+ corresponding `#prefix` method to the `MatchClauses` module. This allows the
16
+ use of Elasticsearch's
17
+ [prefix](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-prefix-query.html)
18
+ query with the Query Builder.
19
+
11
20
  ## [29.9.0] - 2026-08-04
12
21
 
13
22
  ### Added
@@ -5,6 +5,7 @@ require_relative 'ids'
5
5
  require_relative 'match_all'
6
6
  require_relative 'match_none'
7
7
  require_relative 'match_phrase'
8
+ require_relative 'prefix'
8
9
  require_relative 'query_string'
9
10
  require_relative 'range'
10
11
  require_relative 'regexp'
@@ -31,6 +32,16 @@ module JayAPI
31
32
  self << ::JayAPI::Elasticsearch::QueryBuilder::QueryClauses::MatchPhrase.new(**params)
32
33
  end
33
34
 
35
+ # Adds a +JayAPI::Elasticsearch::QueryBuilder::QueryClauses::Prefix+
36
+ # clause to the Query Clauses set.
37
+ # @param [Hash] params The parameters for the +Prefix+ class.
38
+ # @return [self] Returns itself so that other methods can be chained.
39
+ # @raise [JayAPI::Elasticsearch::QueryBuilder::Errors::QueryBuilderError]
40
+ # If an error occurs when trying to add the query clause to the set.
41
+ def prefix(**params)
42
+ self << ::JayAPI::Elasticsearch::QueryBuilder::QueryClauses::Prefix.new(**params)
43
+ end
44
+
34
45
  # Adds a +JayAPI::Elasticsearch::QueryBuilder::QueryClauses::QueryString+
35
46
  # clause to the Query Clauses set.
36
47
  # @param [Hash] params The parameters for the +QueryString+ class
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'query_clause'
4
+
5
+ module JayAPI
6
+ module Elasticsearch
7
+ class QueryBuilder
8
+ class QueryClauses
9
+ # Represents a +Prefix+ query in Elasticsearch
10
+ # More information about this type of query can be found here:
11
+ # https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-prefix-query.html
12
+ class Prefix < ::JayAPI::Elasticsearch::QueryBuilder::QueryClauses::QueryClause
13
+ attr_reader :field, :value
14
+
15
+ # @param [String, Symbol] field The field where the prefix query
16
+ # should be applied.
17
+ # @param [String] value The prefix to be found in +field+
18
+ def initialize(field:, value:)
19
+ super()
20
+ @field = field
21
+ @value = value
22
+ end
23
+
24
+ # @return [Hash] The Hash that represents this query (in
25
+ # Elasticsearch's format)
26
+ def to_h
27
+ {
28
+ prefix: {
29
+ field => {
30
+ value: value
31
+ }
32
+ }
33
+ }
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -24,7 +24,8 @@ module JayAPI
24
24
  # @param [JayAPI::Elasticsearch::Indexable] index The Elasticsearch
25
25
  # index or indexes over which the query should be performed.
26
26
  # @param [Hash] query The query that produced the results.
27
- # @param [JayAPI::Elasticsearch::Results] response An object containing Docs retrieved from Elasticsearch.
27
+ # @param [JayAPI::Elasticsearch::Response] response An object containing
28
+ # Docs retrieved from Elasticsearch.
28
29
  # @param [JayAPI::Elasticsearch::BatchCounter] batch_counter An object keeping track of the current batch.
29
30
  def initialize(index:, query:, response:, batch_counter: nil)
30
31
  @index = index
@@ -2,5 +2,5 @@
2
2
 
3
3
  module JayAPI
4
4
  # JayAPI gem's semantic version
5
- VERSION = '29.9.0'
5
+ VERSION = '29.10.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.9.0
4
+ version: 29.10.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: 2026-08-04 00:00:00.000000000 Z
12
+ date: 2026-08-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -169,6 +169,7 @@ files:
169
169
  - lib/jay_api/elasticsearch/query_builder/query_clauses/match_none.rb
170
170
  - lib/jay_api/elasticsearch/query_builder/query_clauses/match_phrase.rb
171
171
  - lib/jay_api/elasticsearch/query_builder/query_clauses/negator.rb
172
+ - lib/jay_api/elasticsearch/query_builder/query_clauses/prefix.rb
172
173
  - lib/jay_api/elasticsearch/query_builder/query_clauses/query_clause.rb
173
174
  - lib/jay_api/elasticsearch/query_builder/query_clauses/query_string.rb
174
175
  - lib/jay_api/elasticsearch/query_builder/query_clauses/range.rb