opensearch-ruby 3.1.0 → 3.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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/USER_GUIDE.md +5 -3
- data/lib/opensearch/api/actions/search.rb +2 -0
- data/lib/opensearch/dsl/search/options.rb +3 -3
- data/lib/opensearch/dsl/search/queries/match.rb +0 -1
- data/lib/opensearch/dsl/search.rb +1 -1
- data/lib/opensearch/transport/client.rb +4 -4
- data/lib/opensearch/transport/transport/base.rb +0 -2
- data/lib/opensearch/version.rb +1 -1
- data/lib/opensearch.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +3 -4
- metadata.gz.sig +0 -0
- data/lib/opensearch/api/actions/delete_by_rethrottle.rb +0 -55
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 4df9e2bb2805922ffea24e6e5f19e9fd5da1144a19ae69897320d02a08ce4d45
         | 
| 4 | 
            +
              data.tar.gz: 366a83a83650c80e2dd991917c2681c94c71406813446ce607e73c23c5b30def
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: f032360a5c22d9a14eeb9f15317d1d634260a08bc55f49c2a230ffbba9419e458800082033d7b18cab74bf29df866f0c9e994f9c2483154f5988653e8187f920
         | 
| 7 | 
            +
              data.tar.gz: 58a70490e2441dce32b5844632c7a9eafb235805cdcec0927c80d8514ea8cdb2b71fbee4061fbb88aeae05038a024af359e917ee76c1cbd1778dcfdc187f08c2
         | 
    
        checksums.yaml.gz.sig
    CHANGED
    
    | Binary file | 
    
        data/USER_GUIDE.md
    CHANGED
    
    | @@ -13,8 +13,8 @@ To add the client to your project, install it using [RubyGems](https://rubygems. | |
| 13 13 | 
             
            `gem install opensearch-ruby`
         | 
| 14 14 |  | 
| 15 15 | 
             
            or add it to your Gemfile:
         | 
| 16 | 
            -
            ```
         | 
| 17 | 
            -
            gem opensearch-ruby
         | 
| 16 | 
            +
            ```ruby
         | 
| 17 | 
            +
            gem 'opensearch-ruby'
         | 
| 18 18 | 
             
            ```
         | 
| 19 19 | 
             
            and run:
         | 
| 20 20 | 
             
            ```
         | 
| @@ -23,7 +23,9 @@ bundle install | |
| 23 23 |  | 
| 24 24 | 
             
            Import the client:
         | 
| 25 25 |  | 
| 26 | 
            -
             | 
| 26 | 
            +
            ```ruby
         | 
| 27 | 
            +
            require 'opensearch'
         | 
| 28 | 
            +
            ```
         | 
| 27 29 |  | 
| 28 30 | 
             
            ## Basic Usage
         | 
| 29 31 | 
             
            ```ruby
         | 
| @@ -48,6 +48,7 @@ module OpenSearch | |
| 48 48 | 
             
                  # @option arguments [String] :q Query in the Lucene query string syntax
         | 
| 49 49 | 
             
                  # @option arguments [List] :routing A comma-separated list of specific routing values
         | 
| 50 50 | 
             
                  # @option arguments [Time] :scroll Specify how long a consistent view of the index should be maintained for scrolled search
         | 
| 51 | 
            +
                  # @option arguments [String] :search_pipeline Customizable sequence of processing stages applied to search queries.
         | 
| 51 52 | 
             
                  # @option arguments [String] :search_type Search operation type (options: query_then_fetch, dfs_query_then_fetch)
         | 
| 52 53 | 
             
                  # @option arguments [Number] :size Number of hits to return (default: 10)
         | 
| 53 54 | 
             
                  # @option arguments [List] :sort A comma-separated list of <field>:<direction> pairs
         | 
| @@ -128,6 +129,7 @@ module OpenSearch | |
| 128 129 | 
             
                    q
         | 
| 129 130 | 
             
                    routing
         | 
| 130 131 | 
             
                    scroll
         | 
| 132 | 
            +
                    search_pipeline
         | 
| 131 133 | 
             
                    search_type
         | 
| 132 134 | 
             
                    size
         | 
| 133 135 | 
             
                    sort
         | 
| @@ -55,10 +55,10 @@ module OpenSearch | |
| 55 55 | 
             
                      define_method name do |*args|
         | 
| 56 56 | 
             
                        @hash[name] = args.pop
         | 
| 57 57 | 
             
                      end
         | 
| 58 | 
            +
                    end
         | 
| 58 59 |  | 
| 59 | 
            -
             | 
| 60 | 
            -
             | 
| 61 | 
            -
                      end
         | 
| 60 | 
            +
                    def source(*args)
         | 
| 61 | 
            +
                      @hash[:_source] = args.pop
         | 
| 62 62 | 
             
                    end
         | 
| 63 63 |  | 
| 64 64 | 
             
                    # Returns true when there are no search options defined
         | 
| @@ -24,8 +24,6 @@ | |
| 24 24 | 
             
            # specific language governing permissions and limitations
         | 
| 25 25 | 
             
            # under the License.
         | 
| 26 26 |  | 
| 27 | 
            -
            require 'base64'
         | 
| 28 | 
            -
             | 
| 29 27 | 
             
            module OpenSearch
         | 
| 30 28 | 
             
              module Transport
         | 
| 31 29 | 
             
                # Handles communication with an OpenSearch cluster.
         | 
| @@ -225,7 +223,8 @@ module OpenSearch | |
| 225 223 | 
             
                    return unless arguments[:cloud_id] && !arguments[:cloud_id].empty?
         | 
| 226 224 |  | 
| 227 225 | 
             
                    name = arguments[:cloud_id].split(':')[0]
         | 
| 228 | 
            -
                     | 
| 226 | 
            +
                    base64_decoded = arguments[:cloud_id].gsub("#{name}:", '').unpack1('m')
         | 
| 227 | 
            +
                    cloud_url, opensearch_instance = base64_decoded.split('$')
         | 
| 229 228 |  | 
| 230 229 | 
             
                    if cloud_url.include?(':')
         | 
| 231 230 | 
             
                      url, port = cloud_url.split(':')
         | 
| @@ -355,7 +354,8 @@ module OpenSearch | |
| 355 354 | 
             
                  # Encode credentials for the Authorization Header
         | 
| 356 355 | 
             
                  # Credentials is the base64 encoding of id and api_key joined by a colon
         | 
| 357 356 | 
             
                  def __encode(api_key)
         | 
| 358 | 
            -
                     | 
| 357 | 
            +
                    joined = [api_key[:id], api_key[:api_key]].join(':')
         | 
| 358 | 
            +
                    [joined].pack('m0')
         | 
| 359 359 | 
             
                  end
         | 
| 360 360 | 
             
                end
         | 
| 361 361 | 
             
              end
         | 
    
        data/lib/opensearch/version.rb
    CHANGED
    
    
    
        data/lib/opensearch.rb
    CHANGED
    
    
    
        data.tar.gz.sig
    CHANGED
    
    | Binary file | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: opensearch-ruby
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 3. | 
| 4 | 
            +
              version: 3.3.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Elastic
         | 
| @@ -31,7 +31,7 @@ cert_chain: | |
| 31 31 | 
             
              1DlemA1SsUBIoF7CwtVd/RTG/K1iT6nBD08fdKxodMhI5ujkP3N7gkxzRf6aKN4z
         | 
| 32 32 | 
             
              glnDJYZjluKBUsKTOLdPW1CZpb0AHLpNqDf8SVHsPFk=
         | 
| 33 33 | 
             
              -----END CERTIFICATE-----
         | 
| 34 | 
            -
            date:  | 
| 34 | 
            +
            date: 2024-04-30 00:00:00.000000000 Z
         | 
| 35 35 | 
             
            dependencies:
         | 
| 36 36 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 37 37 | 
             
              name: faraday
         | 
| @@ -143,7 +143,6 @@ files: | |
| 143 143 | 
             
            - lib/opensearch/api/actions/delete_all_pits.rb
         | 
| 144 144 | 
             
            - lib/opensearch/api/actions/delete_by_query.rb
         | 
| 145 145 | 
             
            - lib/opensearch/api/actions/delete_by_query_rethrottle.rb
         | 
| 146 | 
            -
            - lib/opensearch/api/actions/delete_by_rethrottle.rb
         | 
| 147 146 | 
             
            - lib/opensearch/api/actions/delete_pit.rb
         | 
| 148 147 | 
             
            - lib/opensearch/api/actions/delete_script.rb
         | 
| 149 148 | 
             
            - lib/opensearch/api/actions/exists.rb
         | 
| @@ -540,7 +539,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 540 539 | 
             
                - !ruby/object:Gem::Version
         | 
| 541 540 | 
             
                  version: '0'
         | 
| 542 541 | 
             
            requirements: []
         | 
| 543 | 
            -
            rubygems_version: 3.3. | 
| 542 | 
            +
            rubygems_version: 3.3.27
         | 
| 544 543 | 
             
            signing_key: 
         | 
| 545 544 | 
             
            specification_version: 4
         | 
| 546 545 | 
             
            summary: Ruby Client for OpenSearch
         | 
    
        metadata.gz.sig
    CHANGED
    
    | Binary file | 
| @@ -1,55 +0,0 @@ | |
| 1 | 
            -
            # SPDX-License-Identifier: Apache-2.0
         | 
| 2 | 
            -
            #
         | 
| 3 | 
            -
            # The OpenSearch Contributors require contributions made to
         | 
| 4 | 
            -
            # this file be licensed under the Apache-2.0 license or a
         | 
| 5 | 
            -
            # compatible open source license.
         | 
| 6 | 
            -
            #
         | 
| 7 | 
            -
            # Modifications Copyright OpenSearch Contributors. See
         | 
| 8 | 
            -
            # GitHub history for details.
         | 
| 9 | 
            -
            #
         | 
| 10 | 
            -
            # Licensed to Elasticsearch B.V. under one or more contributor
         | 
| 11 | 
            -
            # license agreements. See the NOTICE file distributed with
         | 
| 12 | 
            -
            # this work for additional information regarding copyright
         | 
| 13 | 
            -
            # ownership. Elasticsearch B.V. licenses this file to you under
         | 
| 14 | 
            -
            # the Apache License, Version 2.0 (the "License"); you may
         | 
| 15 | 
            -
            # not use this file except in compliance with the License.
         | 
| 16 | 
            -
            # You may obtain a copy of the License at
         | 
| 17 | 
            -
            #
         | 
| 18 | 
            -
            #   http://www.apache.org/licenses/LICENSE-2.0
         | 
| 19 | 
            -
            #
         | 
| 20 | 
            -
            # Unless required by applicable law or agreed to in writing,
         | 
| 21 | 
            -
            # software distributed under the License is distributed on an
         | 
| 22 | 
            -
            # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
         | 
| 23 | 
            -
            # KIND, either express or implied.  See the License for the
         | 
| 24 | 
            -
            # specific language governing permissions and limitations
         | 
| 25 | 
            -
            # under the License.
         | 
| 26 | 
            -
             | 
| 27 | 
            -
            module OpenSearch
         | 
| 28 | 
            -
              module API
         | 
| 29 | 
            -
                module Actions
         | 
| 30 | 
            -
                  # The value of requests_per_second can be changed on a running delete by query using the _rethrottle API
         | 
| 31 | 
            -
                  #
         | 
| 32 | 
            -
                  # @option arguments [String] :task_id The task id to rethrottle (*Required*)
         | 
| 33 | 
            -
                  # @option arguments [Number] :requests_per_second The throttle to set on this request in floating sub-requests per second. -1 means set no throttle.
         | 
| 34 | 
            -
                  #
         | 
| 35 | 
            -
                  #
         | 
| 36 | 
            -
                  def delete_by_query_rethrottle(arguments = {})
         | 
| 37 | 
            -
                    raise ArgumentError, "Required argument 'task_id' missing" unless arguments[:task_id]
         | 
| 38 | 
            -
             | 
| 39 | 
            -
                    method = OpenSearch::API::HTTP_POST
         | 
| 40 | 
            -
                    path   = "_delete_by_query/#{arguments[:task_id]}/_rethrottle"
         | 
| 41 | 
            -
                    params = OpenSearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
         | 
| 42 | 
            -
                    body   = nil
         | 
| 43 | 
            -
             | 
| 44 | 
            -
                    perform_request(method, path, params, body).body
         | 
| 45 | 
            -
                  end
         | 
| 46 | 
            -
             | 
| 47 | 
            -
                  # Register this action with its valid params when the module is loaded.
         | 
| 48 | 
            -
                  #
         | 
| 49 | 
            -
                  # @since 6.2.0
         | 
| 50 | 
            -
                  ParamsRegistry.register(:delete_by_query_rethrottle, [
         | 
| 51 | 
            -
                    :requests_per_second
         | 
| 52 | 
            -
                  ].freeze)
         | 
| 53 | 
            -
                end
         | 
| 54 | 
            -
              end
         | 
| 55 | 
            -
            end
         |