sequel-elasticsearch 0.4.7 → 0.4.8
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/lib/sequel/plugins/elasticsearch.rb +13 -13
- data/lib/sequel/plugins/elasticsearch/version.rb +1 -1
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 7d297d1a447dae85be685cef2d12b2f38ba9734259318b1bb7b2bd2458b6325e
         | 
| 4 | 
            +
              data.tar.gz: 61aef4399f9f5faeb8bcb37ac74dedf386277d533dfb75996d7744fa1a4ab0f4
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: f6d774d669be05c6b1030df3ca8ba83a2ce0ee62e3685d9b8d8cb0163a3b542584fb10f09569046529dd5795de3b5efb5cd1f7079009e68df6d867324dc498bd
         | 
| 7 | 
            +
              data.tar.gz: b18e6af022f73da17285030c2a7ff880eec87b8df183481efbb8e49915cdff03ad2d5e1294d1092fc8fc9a5c5590ede4649f6fe9c9f9f6e36d043fc6d12b52ef
         | 
| @@ -92,23 +92,23 @@ module Sequel | |
| 92 92 |  | 
| 93 93 | 
             
                      # Index all the documents
         | 
| 94 94 | 
             
                      body = []
         | 
| 95 | 
            -
                      dataset. | 
| 96 | 
            -
                        body  | 
| 97 | 
            -
             | 
| 98 | 
            -
             | 
| 99 | 
            -
             | 
| 100 | 
            -
                             | 
| 101 | 
            -
             | 
| 95 | 
            +
                      dataset.each_page(batch_size) do |ds|
         | 
| 96 | 
            +
                        body = []
         | 
| 97 | 
            +
                        ds.all.each do |row|
         | 
| 98 | 
            +
                          print '.'
         | 
| 99 | 
            +
                          body << {
         | 
| 100 | 
            +
                            update: {
         | 
| 101 | 
            +
                              _index: index_name,
         | 
| 102 | 
            +
                              _type: elasticsearch_type,
         | 
| 103 | 
            +
                              _id: row.document_id,
         | 
| 104 | 
            +
                              data: { doc: row.indexed_values, doc_as_upsert: true }
         | 
| 105 | 
            +
                            }
         | 
| 102 106 | 
             
                          }
         | 
| 103 | 
            -
                         | 
| 104 | 
            -
                        print '.'
         | 
| 105 | 
            -
                        next unless body.count >= batch_size
         | 
| 107 | 
            +
                        end
         | 
| 106 108 | 
             
                        puts '/'
         | 
| 107 | 
            -
             | 
| 108 109 | 
             
                        es_client.bulk body: body
         | 
| 109 | 
            -
                        body =  | 
| 110 | 
            +
                        body = nil
         | 
| 110 111 | 
             
                      end
         | 
| 111 | 
            -
                      es_client.bulk body: body if body.count.positive?
         | 
| 112 112 | 
             
                    end
         | 
| 113 113 |  | 
| 114 114 | 
             
                    # Creates a new index in Elasticsearch from the specified dataset, as
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: sequel-elasticsearch
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.4. | 
| 4 | 
            +
              version: 0.4.8
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Jurgens du Toit
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: exe
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2019- | 
| 11 | 
            +
            date: 2019-11-04 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: elasticsearch
         |