elastic_adapter 0.0.8 → 0.1.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
- data/.codeclimate.yml +8 -0
- data/lib/elastic_adapter/index.rb +16 -15
- data/lib/elastic_adapter/response.rb +25 -0
- data/lib/elastic_adapter/responses/with_aggregations.rb +9 -0
- data/lib/elastic_adapter/responses/with_count.rb +9 -0
- data/lib/elastic_adapter/responses/with_exception.rb +9 -0
- data/lib/elastic_adapter/responses/with_hit.rb +24 -0
- data/lib/elastic_adapter/responses/with_hits.rb +18 -0
- data/lib/elastic_adapter/responses/with_suggestions.rb +9 -0
- data/lib/elastic_adapter/responses/with_validations.rb +13 -0
- data/lib/elastic_adapter/version.rb +1 -1
- data/lib/elastic_adapter.rb +8 -9
- data/spec/cassettes/ElasticAdapter_Index/_aggregate/response/{is_a_AggregationResponse.yml → has_a_aggregation.yml} +3 -3
- data/spec/cassettes/ElasticAdapter_Index/_aggregate/response/is_a_WithAggregation.yml +30 -0
- data/spec/cassettes/ElasticAdapter_Index/_aggregate.yml +8 -8
- data/spec/cassettes/ElasticAdapter_Index/_count/empty_index/is_a_fixnum.yml +5 -5
- data/spec/cassettes/ElasticAdapter_Index/_count/empty_index/returns_the_amount_of_all_documents.yml +1 -1
- data/spec/cassettes/ElasticAdapter_Index/_count/empty_index.yml +2 -2
- data/spec/cassettes/ElasticAdapter_Index/_count/not_empty_index/is_a_fixnum.yml +5 -5
- data/spec/cassettes/ElasticAdapter_Index/_count/not_empty_index/returns_1.yml +1 -1
- data/spec/cassettes/ElasticAdapter_Index/_count/not_empty_index.yml +4 -4
- data/spec/cassettes/ElasticAdapter_Index/_create_index/index_is_present/response/has_an_exception.yml +1 -1
- data/spec/cassettes/ElasticAdapter_Index/_create_index/index_is_present/response/is_a_Response.yml +1 -1
- data/spec/cassettes/ElasticAdapter_Index/_create_index/index_is_present.yml +2 -2
- data/spec/cassettes/ElasticAdapter_Index/_create_index/index_not_present/response/has_no_exception.yml +1 -1
- data/spec/cassettes/ElasticAdapter_Index/_create_index/index_not_present/response/is_a_Response.yml +1 -1
- data/spec/cassettes/ElasticAdapter_Index/_create_index/index_not_present/response.yml +1 -1
- data/spec/cassettes/ElasticAdapter_Index/_delete_index/index_not_present/repsonse/has_an_exception.yml +1 -1
- data/spec/cassettes/ElasticAdapter_Index/_delete_index/index_not_present/repsonse/is_a_Response.yml +1 -1
- data/spec/cassettes/ElasticAdapter_Index/_delete_index/index_present/repsonse/has_no_exception.yml +1 -1
- data/spec/cassettes/ElasticAdapter_Index/_delete_index/index_present/repsonse/has_no_exceptionElasticAdapter_Index/_delete_index/index_present/repsonse.yml +1 -1
- data/spec/cassettes/ElasticAdapter_Index/_delete_index/index_present/repsonse/is_a_Response.yml +1 -1
- data/spec/cassettes/ElasticAdapter_Index/_delete_index/index_present/repsonse/is_a_ResponseElasticAdapter_Index/_delete_index/index_present/repsonse.yml +1 -1
- data/spec/cassettes/ElasticAdapter_Index/_get/document_exists/response/document/returns_the_document.yml +1 -1
- data/spec/cassettes/ElasticAdapter_Index/_get/document_exists.yml +3 -3
- data/spec/cassettes/ElasticAdapter_Index/_index/existing_document/doesn_t_change_the_document_count.yml +1 -55
- data/spec/cassettes/ElasticAdapter_Index/_index/existing_document/invokes_to_hash_on_the_document.yml +2 -2
- data/spec/cassettes/ElasticAdapter_Index/_index/existing_document/updates_the_document.yml +2 -2
- data/spec/cassettes/ElasticAdapter_Index/_index/existing_document.yml +3 -3
- data/spec/cassettes/ElasticAdapter_Index/_index/new_document/indexes_a_document.yml +3 -3
- data/spec/cassettes/ElasticAdapter_Index/_index/new_document/invokes_to_hash_on_the_document.yml +2 -2
- data/spec/cassettes/ElasticAdapter_Index/_index/new_document.yml +2 -2
- data/spec/cassettes/ElasticAdapter_Index/_search/match_all/returns_all_documents.yml +2 -2
- data/spec/cassettes/ElasticAdapter_Index/_search/zoo/returns_one_document.yml +3 -3
- data/spec/cassettes/ElasticAdapter_Index/_search/zoo/returns_the_wanted_document.yml +2 -2
- data/spec/cassettes/ElasticAdapter_Index/_search.yml +16 -16
- data/spec/cassettes/ElasticAdapter_Index/_suggest/query_ba_/returns_bar.yml +1 -1
- data/spec/cassettes/ElasticAdapter_Index/_suggest/query_ba_/returns_one_result.yml +1 -1
- data/spec/cassettes/ElasticAdapter_Index/_suggest.yml +4 -4
- data/spec/cassettes/ElasticAdapter_Index/_validate/invalid_query/is_a_response.yml +1 -1
- data/spec/cassettes/ElasticAdapter_Index/_validate/invalid_query/valid_/is_false.yml +1 -1
- data/spec/cassettes/ElasticAdapter_Index/_validate/valid_query/is_a_response.yml +1 -1
- data/spec/cassettes/ElasticAdapter_Index/_validate/valid_query/is_true.yml +1 -1
- data/spec/cassettes/ElasticAdapter_Index/_validate.yml +2 -2
- data/spec/{index → integration/index}/aggregation_spec.rb +10 -2
- data/spec/{index → integration/index}/count_spec.rb +5 -10
- data/spec/{index → integration/index}/create_index_spec.rb +0 -0
- data/spec/{index → integration/index}/delete_index_spec.rb +0 -0
- data/spec/{index → integration/index}/get_spec.rb +8 -1
- data/spec/integration/index/index_spec.rb +28 -0
- data/spec/{index → integration/index}/search_spec.rb +2 -2
- data/spec/{index → integration/index}/shared_context.rb +0 -0
- data/spec/{index → integration/index}/shared_examples.rb +2 -2
- data/spec/{index → integration/index}/suggest_spec.rb +2 -6
- data/spec/{index → integration/index}/unit_spec.rb +0 -0
- data/spec/{index → integration/index}/validate_spec.rb +1 -16
- data/spec/{document_type_spec.rb → unit/document_type_spec.rb} +0 -0
- data/spec/{elastic_adapter_spec.rb → unit/elastic_adapter_spec.rb} +0 -0
- data/spec/unit/index_spec.rb +218 -0
- data/spec/unit/response_spec.rb +28 -0
- data/spec/unit/responses/with_aggregations_spec.rb +30 -0
- data/spec/unit/responses/with_count_spec.rb +22 -0
- data/spec/unit/responses/with_exception_spec.rb +17 -0
- data/spec/unit/responses/with_hit_spec.rb +49 -0
- data/spec/unit/responses/with_hits_spec.rb +79 -0
- data/spec/unit/responses/with_suggestions_spec.rb +33 -0
- data/spec/unit/responses/with_validations_spec.rb +34 -0
- metadata +61 -65
- data/lib/elastic_adapter/responses/aggregation_response.rb +0 -28
- data/lib/elastic_adapter/responses/base_response.rb +0 -28
- data/lib/elastic_adapter/responses/count_response.rb +0 -13
- data/lib/elastic_adapter/responses/get_response.rb +0 -13
- data/lib/elastic_adapter/responses/response_decorator_factory.rb +0 -28
- data/lib/elastic_adapter/responses/sanitized_response.rb +0 -46
- data/lib/elastic_adapter/responses/search_response.rb +0 -33
- data/lib/elastic_adapter/responses/suggestion_response.rb +0 -46
- data/lib/elastic_adapter/responses/validation_response.rb +0 -18
- data/spec/cassettes/ElasticAdapter_Index/_count/empty_index/is_a_response.yml +0 -30
- data/spec/cassettes/ElasticAdapter_Index/_count/empty_index/number.yml +0 -57
- data/spec/cassettes/ElasticAdapter_Index/_count/not_empty_index/is_a_response.yml +0 -30
- data/spec/index/index_spec.rb +0 -60
- data/spec/responses/aggregation_response_spec.rb +0 -57
- data/spec/responses/base_response_spec.rb +0 -19
- data/spec/responses/count_response_spec.rb +0 -24
- data/spec/responses/get_response_spec.rb +0 -29
- data/spec/responses/response_decorator_factory_spec.rb +0 -126
- data/spec/responses/sanitized_response_spec.rb +0 -36
- data/spec/responses/search_response_spec.rb +0 -122
- data/spec/responses/suggestion_response_spec.rb +0 -63
- data/spec/responses/validation_response_spec.rb +0 -45
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 901b49ff68803afe86d9f34df44a74bf4a763c20
         | 
| 4 | 
            +
              data.tar.gz: a60382f88af95ecd4f827436e82e28a35ce3141a
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: c210df90a3fb29054c629f3a6d2138b45e4a2da6b34a0250a291acb58fe18d9919e37b8b5d88bf727691c6ff0cd3cfcd47bb3cf5bcb09a8de2d07b278db29c52
         | 
| 7 | 
            +
              data.tar.gz: aaf13649c527376f157f09c4d007296cc7f1360d9baba31a38ef43f08ea5ef277a6cd94bffadbc8dcf77edae18bc7ea8a685ebe8d5564bf54818973be5d2c6c7
         | 
    
        data/.codeclimate.yml
    ADDED
    
    
| @@ -29,6 +29,8 @@ module ElasticAdapter | |
| 29 29 | 
             
              class Index
         | 
| 30 30 | 
             
                attr_reader :name, :settings, :document_type, :url, :log, :client
         | 
| 31 31 |  | 
| 32 | 
            +
                ELASTICSEARCH_ERRORS = [Elasticsearch::Transport::Transport::Error]
         | 
| 33 | 
            +
             | 
| 32 34 | 
             
                # @param [Hash] params
         | 
| 33 35 | 
             
                # @option params [String] :name required
         | 
| 34 36 | 
             
                # @option params [Hash] :settings required
         | 
| @@ -87,9 +89,7 @@ module ElasticAdapter | |
| 87 89 | 
             
                def count(query = { query: { match_all: {} } })
         | 
| 88 90 | 
             
                  response = handle_api_call :count do
         | 
| 89 91 | 
             
                    client.count index: name, body: query
         | 
| 90 | 
            -
                  end
         | 
| 91 | 
            -
             | 
| 92 | 
            -
                  response.count || response
         | 
| 92 | 
            +
                  end.extend(Responses::WithCount)
         | 
| 93 93 | 
             
                end
         | 
| 94 94 |  | 
| 95 95 | 
             
                # Indexes a Hash or anything that responds to to_hash as a document
         | 
| @@ -133,7 +133,7 @@ module ElasticAdapter | |
| 133 133 | 
             
                      type: document_type.name,
         | 
| 134 134 | 
             
                      id: id
         | 
| 135 135 | 
             
                    )
         | 
| 136 | 
            -
                  end
         | 
| 136 | 
            +
                  end.extend(Responses::WithHit)
         | 
| 137 137 | 
             
                end
         | 
| 138 138 |  | 
| 139 139 | 
             
                # Searches the index for documents matching the passed query.
         | 
| @@ -153,6 +153,9 @@ module ElasticAdapter | |
| 153 153 | 
             
                      body: query
         | 
| 154 154 | 
             
                    )
         | 
| 155 155 | 
             
                  end
         | 
| 156 | 
            +
                    .extend(Responses::WithSuggestions)
         | 
| 157 | 
            +
                    .extend(Responses::WithAggregations)
         | 
| 158 | 
            +
                    .extend(Responses::WithHits)
         | 
| 156 159 | 
             
                end
         | 
| 157 160 |  | 
| 158 161 | 
             
                # Searches the index for suggestions for the passed suggest query
         | 
| @@ -166,12 +169,12 @@ module ElasticAdapter | |
| 166 169 | 
             
                # @param [Hash] query
         | 
| 167 170 | 
             
                # @return [ElasticAdapter::SuggestResponse]
         | 
| 168 171 | 
             
                def suggest(query)
         | 
| 169 | 
            -
                  handle_api_call  | 
| 172 | 
            +
                  handle_api_call do
         | 
| 170 173 | 
             
                    client.suggest(
         | 
| 171 174 | 
             
                      index: name,
         | 
| 172 175 | 
             
                      body: query
         | 
| 173 176 | 
             
                    )
         | 
| 174 | 
            -
                  end
         | 
| 177 | 
            +
                  end.extend(Responses::WithSuggestions)
         | 
| 175 178 | 
             
                end
         | 
| 176 179 |  | 
| 177 180 | 
             
                # Validates the passed query
         | 
| @@ -181,13 +184,13 @@ module ElasticAdapter | |
| 181 184 | 
             
                # @param [Hash] query
         | 
| 182 185 | 
             
                # @return [ElasticAdapter::ValidationResponse]
         | 
| 183 186 | 
             
                def validate(query)
         | 
| 184 | 
            -
                  handle_api_call  | 
| 187 | 
            +
                  handle_api_call do
         | 
| 185 188 | 
             
                    client.indices.validate_query(
         | 
| 186 189 | 
             
                      index: name,
         | 
| 187 190 | 
             
                      explain: true,
         | 
| 188 191 | 
             
                      body: query
         | 
| 189 192 | 
             
                    )
         | 
| 190 | 
            -
                  end
         | 
| 193 | 
            +
                  end.extend(Responses::WithValidations)
         | 
| 191 194 | 
             
                end
         | 
| 192 195 |  | 
| 193 196 | 
             
                # Executes a search request and wraps the response in an AggregationResponse
         | 
| @@ -195,22 +198,20 @@ module ElasticAdapter | |
| 195 198 | 
             
                # @param [Hash] query
         | 
| 196 199 | 
             
                # @return [ElasticAdapter::Decoration::AggregationResponse]
         | 
| 197 200 | 
             
                def aggregate(query)
         | 
| 198 | 
            -
                  handle_api_call  | 
| 201 | 
            +
                  handle_api_call do
         | 
| 199 202 | 
             
                    client.search(
         | 
| 200 203 | 
             
                      index: name,
         | 
| 201 204 | 
             
                      body: query
         | 
| 202 205 | 
             
                    )
         | 
| 203 | 
            -
                  end
         | 
| 206 | 
            +
                  end.extend(Responses::WithAggregations)
         | 
| 204 207 | 
             
                end
         | 
| 205 208 |  | 
| 206 209 | 
             
                private
         | 
| 207 210 |  | 
| 208 211 | 
             
                def handle_api_call(*args)
         | 
| 209 | 
            -
                   | 
| 210 | 
            -
                rescue  | 
| 211 | 
            -
                   | 
| 212 | 
            -
                    exception: e
         | 
| 213 | 
            -
                  )
         | 
| 212 | 
            +
                  Response.new(yield)
         | 
| 213 | 
            +
                rescue *ELASTICSEARCH_ERRORS => e
         | 
| 214 | 
            +
                  Response.new(exception: e).extend(Responses::WithException)
         | 
| 214 215 | 
             
                end
         | 
| 215 216 | 
             
              end
         | 
| 216 217 | 
             
            end
         | 
| @@ -0,0 +1,25 @@ | |
| 1 | 
            +
            require "delegate"
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            module ElasticAdapter
         | 
| 4 | 
            +
              class Response < SimpleDelegator
         | 
| 5 | 
            +
                def initialize(object)
         | 
| 6 | 
            +
                  __setobj__(symbolize_keys(object))
         | 
| 7 | 
            +
                end
         | 
| 8 | 
            +
             | 
| 9 | 
            +
                def object
         | 
| 10 | 
            +
                  __getobj__
         | 
| 11 | 
            +
                end
         | 
| 12 | 
            +
             | 
| 13 | 
            +
                private
         | 
| 14 | 
            +
             | 
| 15 | 
            +
                def symbolize_keys(obj)
         | 
| 16 | 
            +
                  if obj.is_a? Hash
         | 
| 17 | 
            +
                    Hash[obj.map { |k, v| [k.to_sym, symbolize_keys(v)] }]
         | 
| 18 | 
            +
                  elsif obj.is_a? Array
         | 
| 19 | 
            +
                    obj.map { |e| symbolize_keys(e) }
         | 
| 20 | 
            +
                  else
         | 
| 21 | 
            +
                    obj
         | 
| 22 | 
            +
                  end
         | 
| 23 | 
            +
                end
         | 
| 24 | 
            +
              end
         | 
| 25 | 
            +
            end
         | 
| @@ -0,0 +1,24 @@ | |
| 1 | 
            +
            module ElasticAdapter
         | 
| 2 | 
            +
              module Responses
         | 
| 3 | 
            +
                module WithHit
         | 
| 4 | 
            +
                  class Hit < SimpleDelegator
         | 
| 5 | 
            +
                    attr_reader :version
         | 
| 6 | 
            +
             | 
| 7 | 
            +
                    def initialize(response)
         | 
| 8 | 
            +
                      response = response.dup
         | 
| 9 | 
            +
                      @found = response.delete(:found)
         | 
| 10 | 
            +
                      @version = response.delete(:version)
         | 
| 11 | 
            +
                      __setobj__(response)
         | 
| 12 | 
            +
                    end
         | 
| 13 | 
            +
             | 
| 14 | 
            +
                    def found?
         | 
| 15 | 
            +
                      @found
         | 
| 16 | 
            +
                    end
         | 
| 17 | 
            +
                  end
         | 
| 18 | 
            +
             | 
| 19 | 
            +
                  def hit
         | 
| 20 | 
            +
                    @hit ||= Hit.new(object)
         | 
| 21 | 
            +
                  end
         | 
| 22 | 
            +
                end
         | 
| 23 | 
            +
              end
         | 
| 24 | 
            +
            end
         | 
| @@ -0,0 +1,18 @@ | |
| 1 | 
            +
            module ElasticAdapter
         | 
| 2 | 
            +
              module Responses
         | 
| 3 | 
            +
                module WithHits
         | 
| 4 | 
            +
                  class Hits < SimpleDelegator
         | 
| 5 | 
            +
                    attr_reader :count
         | 
| 6 | 
            +
             | 
| 7 | 
            +
                    def initialize(response)
         | 
| 8 | 
            +
                      @count = response.fetch(:hits, {}).fetch(:total, 0)
         | 
| 9 | 
            +
                      __setobj__(response.fetch(:hits, {}).fetch(:hits, []))
         | 
| 10 | 
            +
                    end
         | 
| 11 | 
            +
                  end
         | 
| 12 | 
            +
             | 
| 13 | 
            +
                  def hits
         | 
| 14 | 
            +
                    @hits ||= Hits.new(object)
         | 
| 15 | 
            +
                  end
         | 
| 16 | 
            +
                end
         | 
| 17 | 
            +
              end
         | 
| 18 | 
            +
            end
         | 
    
        data/lib/elastic_adapter.rb
    CHANGED
    
    | @@ -2,16 +2,15 @@ require "elasticsearch" | |
| 2 2 |  | 
| 3 3 | 
             
            require "elastic_adapter/version"
         | 
| 4 4 | 
             
            require "elastic_adapter/document_type"
         | 
| 5 | 
            +
            require "elastic_adapter/response"
         | 
| 5 6 |  | 
| 6 | 
            -
            require "elastic_adapter/responses/ | 
| 7 | 
            -
            require "elastic_adapter/responses/ | 
| 8 | 
            -
            require "elastic_adapter/responses/ | 
| 9 | 
            -
            require "elastic_adapter/responses/ | 
| 10 | 
            -
            require "elastic_adapter/responses/ | 
| 11 | 
            -
            require "elastic_adapter/responses/ | 
| 12 | 
            -
            require "elastic_adapter/responses/ | 
| 13 | 
            -
            require "elastic_adapter/responses/validation_response"
         | 
| 14 | 
            -
            require "elastic_adapter/responses/response_decorator_factory"
         | 
| 7 | 
            +
            require "elastic_adapter/responses/with_exception"
         | 
| 8 | 
            +
            require "elastic_adapter/responses/with_aggregations"
         | 
| 9 | 
            +
            require "elastic_adapter/responses/with_validations"
         | 
| 10 | 
            +
            require "elastic_adapter/responses/with_suggestions"
         | 
| 11 | 
            +
            require "elastic_adapter/responses/with_hits"
         | 
| 12 | 
            +
            require "elastic_adapter/responses/with_hit"
         | 
| 13 | 
            +
            require "elastic_adapter/responses/with_count"
         | 
| 15 14 |  | 
| 16 15 | 
             
            require "elastic_adapter/index"
         | 
| 17 16 |  | 
| @@ -21,10 +21,10 @@ http_interactions: | |
| 21 21 | 
             
                  Content-Type:
         | 
| 22 22 | 
             
                  - application/json; charset=UTF-8
         | 
| 23 23 | 
             
                  Content-Length:
         | 
| 24 | 
            -
                  - ' | 
| 24 | 
            +
                  - '362'
         | 
| 25 25 | 
             
                body:
         | 
| 26 26 | 
             
                  encoding: UTF-8
         | 
| 27 | 
            -
                  string: '{"took": | 
| 27 | 
            +
                  string: '{"took":4,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":1,"max_score":1.0,"hits":[{"_index":"test_index","_type":"test_doc","_id":"AU_7DbDscLMsSRqdq03G","_score":1.0,"_source":{"foo":"bar","group":"A"}}]},"aggregations":{"group":{"doc_count_error_upper_bound":0,"sum_other_doc_count":0,"buckets":[{"key":"a","doc_count":1}]}}}'
         | 
| 28 28 | 
             
                http_version: 
         | 
| 29 | 
            -
              recorded_at:  | 
| 29 | 
            +
              recorded_at: Wed, 23 Sep 2015 16:33:51 GMT
         | 
| 30 30 | 
             
            recorded_with: VCR 2.9.3
         | 
| @@ -0,0 +1,30 @@ | |
| 1 | 
            +
            ---
         | 
| 2 | 
            +
            http_interactions:
         | 
| 3 | 
            +
            - request:
         | 
| 4 | 
            +
                method: get
         | 
| 5 | 
            +
                uri: http://localhost:9200/test_index/_search
         | 
| 6 | 
            +
                body:
         | 
| 7 | 
            +
                  encoding: UTF-8
         | 
| 8 | 
            +
                  string: '{"aggs":{"group":{"terms":{"field":"group"}}}}'
         | 
| 9 | 
            +
                headers:
         | 
| 10 | 
            +
                  User-Agent:
         | 
| 11 | 
            +
                  - Faraday v0.9.1
         | 
| 12 | 
            +
                  Accept-Encoding:
         | 
| 13 | 
            +
                  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
         | 
| 14 | 
            +
                  Accept:
         | 
| 15 | 
            +
                  - "*/*"
         | 
| 16 | 
            +
              response:
         | 
| 17 | 
            +
                status:
         | 
| 18 | 
            +
                  code: 200
         | 
| 19 | 
            +
                  message: OK
         | 
| 20 | 
            +
                headers:
         | 
| 21 | 
            +
                  Content-Type:
         | 
| 22 | 
            +
                  - application/json; charset=UTF-8
         | 
| 23 | 
            +
                  Content-Length:
         | 
| 24 | 
            +
                  - '363'
         | 
| 25 | 
            +
                body:
         | 
| 26 | 
            +
                  encoding: UTF-8
         | 
| 27 | 
            +
                  string: '{"took":95,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":1,"max_score":1.0,"hits":[{"_index":"test_index","_type":"test_doc","_id":"AU_7DbDscLMsSRqdq03G","_score":1.0,"_source":{"foo":"bar","group":"A"}}]},"aggregations":{"group":{"doc_count_error_upper_bound":0,"sum_other_doc_count":0,"buckets":[{"key":"a","doc_count":1}]}}}'
         | 
| 28 | 
            +
                http_version: 
         | 
| 29 | 
            +
              recorded_at: Wed, 23 Sep 2015 16:33:51 GMT
         | 
| 30 | 
            +
            recorded_with: VCR 2.9.3
         | 
| @@ -15,18 +15,18 @@ http_interactions: | |
| 15 15 | 
             
                  - "*/*"
         | 
| 16 16 | 
             
              response:
         | 
| 17 17 | 
             
                status:
         | 
| 18 | 
            -
                  code:  | 
| 19 | 
            -
                  message:  | 
| 18 | 
            +
                  code: 200
         | 
| 19 | 
            +
                  message: OK
         | 
| 20 20 | 
             
                headers:
         | 
| 21 21 | 
             
                  Content-Type:
         | 
| 22 22 | 
             
                  - application/json; charset=UTF-8
         | 
| 23 23 | 
             
                  Content-Length:
         | 
| 24 | 
            -
                  - ' | 
| 24 | 
            +
                  - '21'
         | 
| 25 25 | 
             
                body:
         | 
| 26 26 | 
             
                  encoding: UTF-8
         | 
| 27 | 
            -
                  string: '{" | 
| 27 | 
            +
                  string: '{"acknowledged":true}'
         | 
| 28 28 | 
             
                http_version: 
         | 
| 29 | 
            -
              recorded_at:  | 
| 29 | 
            +
              recorded_at: Wed, 23 Sep 2015 16:33:39 GMT
         | 
| 30 30 | 
             
            - request:
         | 
| 31 31 | 
             
                method: post
         | 
| 32 32 | 
             
                uri: http://localhost:9200/test_index/test_doc
         | 
| @@ -51,9 +51,9 @@ http_interactions: | |
| 51 51 | 
             
                  - '99'
         | 
| 52 52 | 
             
                body:
         | 
| 53 53 | 
             
                  encoding: UTF-8
         | 
| 54 | 
            -
                  string: '{"_index":"test_index","_type":"test_doc","_id":" | 
| 54 | 
            +
                  string: '{"_index":"test_index","_type":"test_doc","_id":"AU_7DbDscLMsSRqdq03G","_version":1,"created":true}'
         | 
| 55 55 | 
             
                http_version: 
         | 
| 56 | 
            -
              recorded_at:  | 
| 56 | 
            +
              recorded_at: Wed, 23 Sep 2015 16:33:42 GMT
         | 
| 57 57 | 
             
            - request:
         | 
| 58 58 | 
             
                method: delete
         | 
| 59 59 | 
             
                uri: http://localhost:9200/test_index
         | 
| @@ -80,5 +80,5 @@ http_interactions: | |
| 80 80 | 
             
                  encoding: UTF-8
         | 
| 81 81 | 
             
                  string: '{"acknowledged":true}'
         | 
| 82 82 | 
             
                http_version: 
         | 
| 83 | 
            -
              recorded_at:  | 
| 83 | 
            +
              recorded_at: Wed, 23 Sep 2015 16:33:51 GMT
         | 
| 84 84 | 
             
            recorded_with: VCR 2.9.3
         | 
| @@ -15,16 +15,16 @@ http_interactions: | |
| 15 15 | 
             
                  - "*/*"
         | 
| 16 16 | 
             
              response:
         | 
| 17 17 | 
             
                status:
         | 
| 18 | 
            -
                  code:  | 
| 19 | 
            -
                  message:  | 
| 18 | 
            +
                  code: 200
         | 
| 19 | 
            +
                  message: OK
         | 
| 20 20 | 
             
                headers:
         | 
| 21 21 | 
             
                  Content-Type:
         | 
| 22 22 | 
             
                  - application/json; charset=UTF-8
         | 
| 23 23 | 
             
                  Content-Length:
         | 
| 24 | 
            -
                  - ' | 
| 24 | 
            +
                  - '59'
         | 
| 25 25 | 
             
                body:
         | 
| 26 26 | 
             
                  encoding: UTF-8
         | 
| 27 | 
            -
                  string: '{" | 
| 27 | 
            +
                  string: '{"count":0,"_shards":{"total":5,"successful":5,"failed":0}}'
         | 
| 28 28 | 
             
                http_version: 
         | 
| 29 | 
            -
              recorded_at:  | 
| 29 | 
            +
              recorded_at: Wed, 23 Sep 2015 16:33:55 GMT
         | 
| 30 30 | 
             
            recorded_with: VCR 2.9.3
         | 
| @@ -26,7 +26,7 @@ http_interactions: | |
| 26 26 | 
             
                  encoding: UTF-8
         | 
| 27 27 | 
             
                  string: '{"acknowledged":true}'
         | 
| 28 28 | 
             
                http_version: 
         | 
| 29 | 
            -
              recorded_at:  | 
| 29 | 
            +
              recorded_at: Wed, 23 Sep 2015 16:33:52 GMT
         | 
| 30 30 | 
             
            - request:
         | 
| 31 31 | 
             
                method: delete
         | 
| 32 32 | 
             
                uri: http://localhost:9200/test_index
         | 
| @@ -53,5 +53,5 @@ http_interactions: | |
| 53 53 | 
             
                  encoding: UTF-8
         | 
| 54 54 | 
             
                  string: '{"acknowledged":true}'
         | 
| 55 55 | 
             
                http_version: 
         | 
| 56 | 
            -
              recorded_at:  | 
| 56 | 
            +
              recorded_at: Wed, 23 Sep 2015 16:33:55 GMT
         | 
| 57 57 | 
             
            recorded_with: VCR 2.9.3
         | 
| @@ -15,16 +15,16 @@ http_interactions: | |
| 15 15 | 
             
                  - "*/*"
         | 
| 16 16 | 
             
              response:
         | 
| 17 17 | 
             
                status:
         | 
| 18 | 
            -
                  code:  | 
| 19 | 
            -
                  message:  | 
| 18 | 
            +
                  code: 200
         | 
| 19 | 
            +
                  message: OK
         | 
| 20 20 | 
             
                headers:
         | 
| 21 21 | 
             
                  Content-Type:
         | 
| 22 22 | 
             
                  - application/json; charset=UTF-8
         | 
| 23 23 | 
             
                  Content-Length:
         | 
| 24 | 
            -
                  - ' | 
| 24 | 
            +
                  - '59'
         | 
| 25 25 | 
             
                body:
         | 
| 26 26 | 
             
                  encoding: UTF-8
         | 
| 27 | 
            -
                  string: '{" | 
| 27 | 
            +
                  string: '{"count":1,"_shards":{"total":5,"successful":5,"failed":0}}'
         | 
| 28 28 | 
             
                http_version: 
         | 
| 29 | 
            -
              recorded_at:  | 
| 29 | 
            +
              recorded_at: Wed, 23 Sep 2015 16:34:01 GMT
         | 
| 30 30 | 
             
            recorded_with: VCR 2.9.3
         | 
| @@ -26,7 +26,7 @@ http_interactions: | |
| 26 26 | 
             
                  encoding: UTF-8
         | 
| 27 27 | 
             
                  string: '{"acknowledged":true}'
         | 
| 28 28 | 
             
                http_version: 
         | 
| 29 | 
            -
              recorded_at:  | 
| 29 | 
            +
              recorded_at: Wed, 23 Sep 2015 16:33:55 GMT
         | 
| 30 30 | 
             
            - request:
         | 
| 31 31 | 
             
                method: post
         | 
| 32 32 | 
             
                uri: http://localhost:9200/test_index/test_doc
         | 
| @@ -51,9 +51,9 @@ http_interactions: | |
| 51 51 | 
             
                  - '99'
         | 
| 52 52 | 
             
                body:
         | 
| 53 53 | 
             
                  encoding: UTF-8
         | 
| 54 | 
            -
                  string: '{"_index":"test_index","_type":"test_doc","_id":" | 
| 54 | 
            +
                  string: '{"_index":"test_index","_type":"test_doc","_id":"AU_7De5LcLMsSRqdq03H","_version":1,"created":true}'
         | 
| 55 55 | 
             
                http_version: 
         | 
| 56 | 
            -
              recorded_at:  | 
| 56 | 
            +
              recorded_at: Wed, 23 Sep 2015 16:33:58 GMT
         | 
| 57 57 | 
             
            - request:
         | 
| 58 58 | 
             
                method: delete
         | 
| 59 59 | 
             
                uri: http://localhost:9200/test_index
         | 
| @@ -80,5 +80,5 @@ http_interactions: | |
| 80 80 | 
             
                  encoding: UTF-8
         | 
| 81 81 | 
             
                  string: '{"acknowledged":true}'
         | 
| 82 82 | 
             
                http_version: 
         | 
| 83 | 
            -
              recorded_at:  | 
| 83 | 
            +
              recorded_at: Wed, 23 Sep 2015 16:34:01 GMT
         | 
| 84 84 | 
             
            recorded_with: VCR 2.9.3
         | 
| @@ -26,5 +26,5 @@ http_interactions: | |
| 26 26 | 
             
                  encoding: UTF-8
         | 
| 27 27 | 
             
                  string: '{"error":"IndexAlreadyExistsException[[test_index] already exists]","status":400}'
         | 
| 28 28 | 
             
                http_version: 
         | 
| 29 | 
            -
              recorded_at:  | 
| 29 | 
            +
              recorded_at: Wed, 23 Sep 2015 16:34:04 GMT
         | 
| 30 30 | 
             
            recorded_with: VCR 2.9.3
         | 
    
        data/spec/cassettes/ElasticAdapter_Index/_create_index/index_is_present/response/is_a_Response.yml
    CHANGED
    
    | @@ -26,5 +26,5 @@ http_interactions: | |
| 26 26 | 
             
                  encoding: UTF-8
         | 
| 27 27 | 
             
                  string: '{"error":"IndexAlreadyExistsException[[test_index] already exists]","status":400}'
         | 
| 28 28 | 
             
                http_version: 
         | 
| 29 | 
            -
              recorded_at:  | 
| 29 | 
            +
              recorded_at: Wed, 23 Sep 2015 16:34:04 GMT
         | 
| 30 30 | 
             
            recorded_with: VCR 2.9.3
         | 
| @@ -26,7 +26,7 @@ http_interactions: | |
| 26 26 | 
             
                  encoding: UTF-8
         | 
| 27 27 | 
             
                  string: '{"acknowledged":true}'
         | 
| 28 28 | 
             
                http_version: 
         | 
| 29 | 
            -
              recorded_at:  | 
| 29 | 
            +
              recorded_at: Wed, 23 Sep 2015 16:34:01 GMT
         | 
| 30 30 | 
             
            - request:
         | 
| 31 31 | 
             
                method: delete
         | 
| 32 32 | 
             
                uri: http://localhost:9200/test_index
         | 
| @@ -53,5 +53,5 @@ http_interactions: | |
| 53 53 | 
             
                  encoding: UTF-8
         | 
| 54 54 | 
             
                  string: '{"acknowledged":true}'
         | 
| 55 55 | 
             
                http_version: 
         | 
| 56 | 
            -
              recorded_at:  | 
| 56 | 
            +
              recorded_at: Wed, 23 Sep 2015 16:34:04 GMT
         | 
| 57 57 | 
             
            recorded_with: VCR 2.9.3
         | 
| @@ -26,5 +26,5 @@ http_interactions: | |
| 26 26 | 
             
                  encoding: UTF-8
         | 
| 27 27 | 
             
                  string: '{"error":"IndexAlreadyExistsException[[test_index] already exists]","status":400}'
         | 
| 28 28 | 
             
                http_version: 
         | 
| 29 | 
            -
              recorded_at:  | 
| 29 | 
            +
              recorded_at: Wed, 23 Sep 2015 16:34:04 GMT
         | 
| 30 30 | 
             
            recorded_with: VCR 2.9.3
         | 
| @@ -26,5 +26,5 @@ http_interactions: | |
| 26 26 | 
             
                  encoding: UTF-8
         | 
| 27 27 | 
             
                  string: '{"_index":"test_index","_type":"test_doc","_id":"1","_version":1,"found":true,"_source":{"foo":"bar"}}'
         | 
| 28 28 | 
             
                http_version: 
         | 
| 29 | 
            -
              recorded_at:  | 
| 29 | 
            +
              recorded_at: Wed, 23 Sep 2015 16:34:17 GMT
         | 
| 30 30 | 
             
            recorded_with: VCR 2.9.3
         | 
| @@ -26,7 +26,7 @@ http_interactions: | |
| 26 26 | 
             
                  encoding: UTF-8
         | 
| 27 27 | 
             
                  string: '{"acknowledged":true}'
         | 
| 28 28 | 
             
                http_version: 
         | 
| 29 | 
            -
              recorded_at:  | 
| 29 | 
            +
              recorded_at: Wed, 23 Sep 2015 16:34:11 GMT
         | 
| 30 30 | 
             
            - request:
         | 
| 31 31 | 
             
                method: put
         | 
| 32 32 | 
             
                uri: http://localhost:9200/test_index/test_doc/1
         | 
| @@ -53,7 +53,7 @@ http_interactions: | |
| 53 53 | 
             
                  encoding: UTF-8
         | 
| 54 54 | 
             
                  string: '{"_index":"test_index","_type":"test_doc","_id":"1","_version":1,"created":true}'
         | 
| 55 55 | 
             
                http_version: 
         | 
| 56 | 
            -
              recorded_at:  | 
| 56 | 
            +
              recorded_at: Wed, 23 Sep 2015 16:34:14 GMT
         | 
| 57 57 | 
             
            - request:
         | 
| 58 58 | 
             
                method: delete
         | 
| 59 59 | 
             
                uri: http://localhost:9200/test_index
         | 
| @@ -80,5 +80,5 @@ http_interactions: | |
| 80 80 | 
             
                  encoding: UTF-8
         | 
| 81 81 | 
             
                  string: '{"acknowledged":true}'
         | 
| 82 82 | 
             
                http_version: 
         | 
| 83 | 
            -
              recorded_at:  | 
| 83 | 
            +
              recorded_at: Wed, 23 Sep 2015 16:34:17 GMT
         | 
| 84 84 | 
             
            recorded_with: VCR 2.9.3
         |