dvla-kaping 1.0.0 → 1.0.4
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 +4 -4
- data/.ruby-version +1 -1
- data/.tool-versions +1 -0
- data/CHANGELOG.md +10 -1
- data/README.md +14 -7
- data/lib/dvla/kaping/aws_client.rb +1 -1
- data/lib/dvla/kaping/version.rb +1 -1
- metadata +55 -7
- data/.drone.yml +0 -122
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 99f6221990bbf656183aec0b2880b716f67038fd43a8e4daa72a80004dc15d76
|
|
4
|
+
data.tar.gz: 20b2397b50c3c0e847b8a0b6b675b53755c90cfaf89674db85922bbb7e7a00c8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 71ec529b6e6dedaa7655ad86b33acf5ccf2edac1d32a6f195eba38033134be880b928796e256efd63cb4cc9dde3d191488c4a781db54f851219a04859ecfa2a2
|
|
7
|
+
data.tar.gz: 0efa699c3eba860ed2b4b03d80fe9a4452eef8dd541e7c39690cb113f6bb715036fb01688acfd1e1be14351318885fdead1a961116749f5da185980df06ab5ef
|
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.4.
|
|
1
|
+
3.4.7
|
data/.tool-versions
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ruby 3.4.7
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
-
## [
|
|
3
|
+
## [1.0.2] - 2024-11-07
|
|
4
4
|
|
|
5
5
|
- Initial release
|
|
6
|
+
|
|
7
|
+
## [1.0.3] - 2025-09-03
|
|
8
|
+
|
|
9
|
+
- Moved runtime dependencies to the gemspec
|
|
10
|
+
|
|
11
|
+
## [1.0.4] - 2025-11-10
|
|
12
|
+
|
|
13
|
+
- Update gems and fixed issue with git actions
|
|
14
|
+
|
data/README.md
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
# Dvla::Kaping
|
|
2
2
|
|
|
3
|
-
The Kaping!
|
|
3
|
+
The Kaping! Gem, an idiomatic way to create DSL openSearch definitions
|
|
4
|
+
|
|
5
|
+
The Ka-Ping Ruby gem enables the user to build complex ElasticSearch DSL Queries for searching and filtering large data sets
|
|
6
|
+
without having to worry about formatting the JSON payloads.
|
|
7
|
+
|
|
8
|
+
Using Ruby dot notation with intuitive search terms and operations, it's easier to construct human-readable search definitions
|
|
9
|
+
without needing a deep understanding of the Query DSL syntax
|
|
10
|
+
|
|
4
11
|
|
|
5
12
|
## OpenSearch Query DSL
|
|
6
13
|
https://opensearch.org/docs/latest/query-dsl/
|
|
@@ -28,10 +35,10 @@ complex to construct so this gem looks to simplify the process.
|
|
|
28
35
|
|
|
29
36
|
## Query and filter context
|
|
30
37
|
|
|
31
|
-
A filter context asks
|
|
38
|
+
A filter context asks: “Does the document match the query clause?” and returns matching documents
|
|
32
39
|
i.e it's a binary answer
|
|
33
40
|
|
|
34
|
-
A query context asks
|
|
41
|
+
A query context asks: “How well does the document match the query clause?”, - also returns a relevance score
|
|
35
42
|
good for full-text searches
|
|
36
43
|
|
|
37
44
|
# How to use
|
|
@@ -55,8 +62,8 @@ DVLA::Kaping.configure { |attr| attr.yaml_override_path = './config/kaping.yml'
|
|
|
55
62
|
```
|
|
56
63
|
The 'index' setting will control what environment to target
|
|
57
64
|
|
|
58
|
-
The 'result_size' setting determines how many records to be returned from the query, if you are doing a post
|
|
59
|
-
code side then you should pump this value up.
|
|
65
|
+
The 'result_size' setting determines how many records to be returned from the query, if you are doing a post-query filtering
|
|
66
|
+
code side, then you should pump this value up.
|
|
60
67
|
|
|
61
68
|
```yml
|
|
62
69
|
kaping:
|
|
@@ -73,7 +80,7 @@ Profile will just pick up the credentials save in your specified shared credenti
|
|
|
73
80
|
|
|
74
81
|
```yml
|
|
75
82
|
aws:
|
|
76
|
-
# to use
|
|
83
|
+
# to use an AWS profile config file then set to profile, otherwise environment settings will be used
|
|
77
84
|
credential_type: profile
|
|
78
85
|
account_id: ##########
|
|
79
86
|
region: aws-region
|
|
@@ -106,7 +113,7 @@ body = DVLA::Kaping::Query.new('bool')
|
|
|
106
113
|
## Query building
|
|
107
114
|
A query can be built up with dot notation, but there are a few rules to follow.
|
|
108
115
|
|
|
109
|
-
First get a new Kaping Query instance. If we want a new Boolean query then we set the type as bool.
|
|
116
|
+
First, get a new Kaping Query instance. If we want a new Boolean query then we set the type as bool.
|
|
110
117
|
```ruby
|
|
111
118
|
my_query = DVLA::Kaping::Query.new('bool')
|
|
112
119
|
my_query.filter.term('foo.bar', 'Valid').
|
data/lib/dvla/kaping/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,35 +1,83 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dvla-kaping
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Driver and Vehicle Licensing Agency (DVLA)
|
|
8
8
|
- Kevin Upstill
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-
|
|
11
|
+
date: 2025-11-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: aws-sdk-sts
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '1.12'
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '1.12'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: aws-sigv4
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '1.8'
|
|
34
|
+
type: :runtime
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '1.8'
|
|
13
41
|
- !ruby/object:Gem::Dependency
|
|
14
42
|
name: nokogiri
|
|
15
43
|
requirement: !ruby/object:Gem::Requirement
|
|
16
44
|
requirements:
|
|
17
45
|
- - "~>"
|
|
18
46
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '1.
|
|
47
|
+
version: '1.18'
|
|
48
|
+
- - ">="
|
|
49
|
+
- !ruby/object:Gem::Version
|
|
50
|
+
version: 1.18.8
|
|
51
|
+
type: :runtime
|
|
52
|
+
prerelease: false
|
|
53
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
54
|
+
requirements:
|
|
55
|
+
- - "~>"
|
|
56
|
+
- !ruby/object:Gem::Version
|
|
57
|
+
version: '1.18'
|
|
58
|
+
- - ">="
|
|
59
|
+
- !ruby/object:Gem::Version
|
|
60
|
+
version: 1.18.8
|
|
61
|
+
- !ruby/object:Gem::Dependency
|
|
62
|
+
name: opensearch-aws-sigv4
|
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
|
64
|
+
requirements:
|
|
65
|
+
- - "~>"
|
|
66
|
+
- !ruby/object:Gem::Version
|
|
67
|
+
version: '1.2'
|
|
20
68
|
- - ">="
|
|
21
69
|
- !ruby/object:Gem::Version
|
|
22
|
-
version: 1.
|
|
70
|
+
version: 1.2.1
|
|
23
71
|
type: :runtime
|
|
24
72
|
prerelease: false
|
|
25
73
|
version_requirements: !ruby/object:Gem::Requirement
|
|
26
74
|
requirements:
|
|
27
75
|
- - "~>"
|
|
28
76
|
- !ruby/object:Gem::Version
|
|
29
|
-
version: '1.
|
|
77
|
+
version: '1.2'
|
|
30
78
|
- - ">="
|
|
31
79
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: 1.
|
|
80
|
+
version: 1.2.1
|
|
33
81
|
description: Wrapper for the AWS elastic search API to create an idiomatic way to
|
|
34
82
|
build complex search queries
|
|
35
83
|
email:
|
|
@@ -38,10 +86,10 @@ executables: []
|
|
|
38
86
|
extensions: []
|
|
39
87
|
extra_rdoc_files: []
|
|
40
88
|
files:
|
|
41
|
-
- ".drone.yml"
|
|
42
89
|
- ".rspec"
|
|
43
90
|
- ".rubocop.yml"
|
|
44
91
|
- ".ruby-version"
|
|
92
|
+
- ".tool-versions"
|
|
45
93
|
- CHANGELOG.md
|
|
46
94
|
- CODE_OF_CONDUCT.md
|
|
47
95
|
- LICENCE
|
data/.drone.yml
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
kind: pipeline
|
|
3
|
-
name: audit, lint & test
|
|
4
|
-
|
|
5
|
-
platform:
|
|
6
|
-
os: linux
|
|
7
|
-
arch: amd64
|
|
8
|
-
|
|
9
|
-
trigger:
|
|
10
|
-
event:
|
|
11
|
-
- push
|
|
12
|
-
|
|
13
|
-
drone_cache_image: &drone_cache_image
|
|
14
|
-
image: 448934085854.dkr.ecr.eu-west-2.amazonaws.com/ce/drone-cache
|
|
15
|
-
pull: if-not-exists
|
|
16
|
-
|
|
17
|
-
drone_cache_settings: &drone_cache_settings
|
|
18
|
-
bucket: dvla-drone1-cache-448934085854
|
|
19
|
-
region: eu-west-2
|
|
20
|
-
encryption: AES256
|
|
21
|
-
endpoint: https://s3.eu-west-2.amazonaws.com
|
|
22
|
-
|
|
23
|
-
gem_cache_mount: &gem_cache_mount
|
|
24
|
-
mount:
|
|
25
|
-
- vendor/bundle
|
|
26
|
-
|
|
27
|
-
ruby_image: &ruby_image
|
|
28
|
-
image: 448934085854.dkr.ecr.eu-west-2.amazonaws.com/base-images/qe-ruby:3
|
|
29
|
-
|
|
30
|
-
sonar_image: &sonar_image
|
|
31
|
-
image: 448934085854.dkr.ecr.eu-west-2.amazonaws.com/utilities-ci-tools/ci-drone-sonar-scanner
|
|
32
|
-
pull: if-not-exists
|
|
33
|
-
|
|
34
|
-
steps:
|
|
35
|
-
- name: Restore gems from cache
|
|
36
|
-
<<: *drone_cache_image
|
|
37
|
-
settings:
|
|
38
|
-
<<: *drone_cache_settings
|
|
39
|
-
<<: *gem_cache_mount
|
|
40
|
-
restore: true
|
|
41
|
-
cache_key: '{{ checksum "./README.md" }}' # Override the README to force a rebuild
|
|
42
|
-
|
|
43
|
-
- name: Unit tests
|
|
44
|
-
<<: *ruby_image
|
|
45
|
-
depends_on:
|
|
46
|
-
- Restore gems from cache
|
|
47
|
-
commands:
|
|
48
|
-
- bundle install
|
|
49
|
-
- bundle exec rspec
|
|
50
|
-
environment:
|
|
51
|
-
BUNDLE_PATH: vendor/bundle
|
|
52
|
-
|
|
53
|
-
- name: Gem audit
|
|
54
|
-
<<: *ruby_image
|
|
55
|
-
depends_on:
|
|
56
|
-
- Restore gems from cache
|
|
57
|
-
commands:
|
|
58
|
-
- bundle install
|
|
59
|
-
- bundle exec bundle-audit
|
|
60
|
-
environment:
|
|
61
|
-
BUNDLE_PATH: vendor/bundle
|
|
62
|
-
|
|
63
|
-
- name: Lint
|
|
64
|
-
<<: *ruby_image
|
|
65
|
-
depends_on:
|
|
66
|
-
- Restore gems from cache
|
|
67
|
-
commands:
|
|
68
|
-
- bundle install
|
|
69
|
-
- bundle exec rubocop
|
|
70
|
-
environment:
|
|
71
|
-
BUNDLE_PATH: vendor/bundle
|
|
72
|
-
|
|
73
|
-
- name: SonarQube
|
|
74
|
-
<<: *sonar_image
|
|
75
|
-
depends_on:
|
|
76
|
-
- Unit tests
|
|
77
|
-
|
|
78
|
-
- name: Build and deploy (dry-run)
|
|
79
|
-
image: 448934085854.dkr.ecr.eu-west-2.amazonaws.com/utilities-ci-tools/ci-qe-deploy-gem:latest
|
|
80
|
-
commands:
|
|
81
|
-
- git fetch origin main
|
|
82
|
-
- app
|
|
83
|
-
environment:
|
|
84
|
-
DRYRUN: true
|
|
85
|
-
VERBOSE: false
|
|
86
|
-
|
|
87
|
-
- name: Rebuild gem cache
|
|
88
|
-
<<: *drone_cache_image
|
|
89
|
-
depends_on:
|
|
90
|
-
- Gem audit
|
|
91
|
-
settings:
|
|
92
|
-
<<: *drone_cache_settings
|
|
93
|
-
<<: *gem_cache_mount
|
|
94
|
-
rebuild: true
|
|
95
|
-
cache_key: '{{ checksum "./README.md" }}'
|
|
96
|
-
|
|
97
|
-
---
|
|
98
|
-
kind: pipeline
|
|
99
|
-
name: deploy
|
|
100
|
-
depends_on:
|
|
101
|
-
- audit, lint & test
|
|
102
|
-
|
|
103
|
-
platform:
|
|
104
|
-
os: linux
|
|
105
|
-
arch: amd64
|
|
106
|
-
|
|
107
|
-
trigger:
|
|
108
|
-
event:
|
|
109
|
-
- push
|
|
110
|
-
branch:
|
|
111
|
-
- main
|
|
112
|
-
|
|
113
|
-
steps:
|
|
114
|
-
- name: Build and deploy
|
|
115
|
-
image: 448934085854.dkr.ecr.eu-west-2.amazonaws.com/utilities-ci-tools/ci-qe-deploy-gem:latest
|
|
116
|
-
commands:
|
|
117
|
-
- git fetch origin main
|
|
118
|
-
- app
|
|
119
|
-
environment:
|
|
120
|
-
DRYRUN: false
|
|
121
|
-
VERBOSE: false
|
|
122
|
-
|