| Conditions | 5 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | # frozen_string_literal: true |
||
| 30 | def load_index(index, _config, show_progress, limit, skip_existing) |
||
| 31 | # Skip this index if it's not empty |
||
| 32 | if skip_existing && [email protected]_empty?(index) |
||
| 33 | @logger.info "Skipping index #{index.inspect}" if show_progress |
||
| 34 | return |
||
| 35 | end |
||
| 36 | @logger.info index.inspect if show_progress |
||
| 37 | |||
| 38 | chunk = Array.new(limit) do |
||
| 39 | Hash[index.all_fields.map do |field| |
||
| 40 | [field.id, field.random_value] |
||
| 41 | end] |
||
| 42 | end |
||
| 43 | |||
| 44 | @backend.index_insert_chunk index, chunk |
||
| 45 | end |
||
| 46 | end |
||
| 49 |