connectors_utility 8.6.0.4.pre.20221115T001812Z → 8.6.0.4.pre.20221115T002329Z
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/utility/filtering.rb +22 -0
- data/lib/utility.rb +1 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 996cc59bf15e82bf245bc30716d0ac93861514fe9f8e73f92948f80e60adccc4
|
4
|
+
data.tar.gz: f904929c8d82a73e1763cf30536c7e703b885d633f05e9cdecbba310eb44d99d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d22401f2411e468c734bb015e6027ede2858a64fcdeb6ea446ad9cc4871c68791e736dea230e5a2fcee2c77b84514c41314cd866f7766bb2906e4396b1c557e8
|
7
|
+
data.tar.gz: e3ed8f7cb8e0d10bfbc220520ff7d98dcc7d221ee65f4790976eb6e1f538f78ac781eaa453258896749ed56e41eb3cf3c065a206cbb209740d43dbe6b37f7b52
|
@@ -0,0 +1,22 @@
|
|
1
|
+
#
|
2
|
+
# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
3
|
+
# or more contributor license agreements. Licensed under the Elastic License;
|
4
|
+
# you may not use this file except in compliance with the Elastic License.
|
5
|
+
#
|
6
|
+
|
7
|
+
# frozen_string_literal: true
|
8
|
+
|
9
|
+
module Utility
|
10
|
+
class Filtering
|
11
|
+
class << self
|
12
|
+
def extract_filter(filtering)
|
13
|
+
return {} unless filtering.present?
|
14
|
+
|
15
|
+
# assume for now, that first object in filtering array or a filter object itself is the only filtering object
|
16
|
+
filter = filtering.is_a?(Array) ? filtering.first : filtering
|
17
|
+
|
18
|
+
filter.present? ? filter : {}
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
data/lib/utility.rb
CHANGED
@@ -12,6 +12,7 @@ require 'utility/elasticsearch/index/mappings'
|
|
12
12
|
require 'utility/elasticsearch/index/text_analysis_settings'
|
13
13
|
require 'utility/environment'
|
14
14
|
require 'utility/errors'
|
15
|
+
require 'utility/filtering'
|
15
16
|
require 'utility/es_client'
|
16
17
|
require 'utility/exception_tracking'
|
17
18
|
require 'utility/extension_mapping_util'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: connectors_utility
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 8.6.0.4.pre.
|
4
|
+
version: 8.6.0.4.pre.20221115T002329Z
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
@@ -123,6 +123,7 @@ files:
|
|
123
123
|
- lib/utility/es_client.rb
|
124
124
|
- lib/utility/exception_tracking.rb
|
125
125
|
- lib/utility/extension_mapping_util.rb
|
126
|
+
- lib/utility/filtering.rb
|
126
127
|
- lib/utility/logger.rb
|
127
128
|
homepage: https://github.com/elastic/connectors-ruby
|
128
129
|
licenses:
|