forked from e621ng/e621ng
Fix post version indexer options
Up batch size to 10k to vastly improve indexing speed. Fix reversed from and to options.
This commit is contained in:
parent
f8b339b3b0
commit
6bfe7e12e9
@ -36,11 +36,11 @@ module PostVersionIndex
|
||||
module ClassMethods
|
||||
def import(options = {})
|
||||
q = all
|
||||
q = q.where("id <= ?", options[:from]) if options[:from]
|
||||
q = q.where("id >= ?", options[:to]) if options[:to]
|
||||
q = q.where("id >= ?", options[:from]) if options[:from]
|
||||
q = q.where("id <= ?", options[:to]) if options[:to]
|
||||
q = q.where(options[:query]) if options[:query]
|
||||
|
||||
q.find_in_batches do |batch|
|
||||
q.find_in_batches(batch_size: 10000) do |batch|
|
||||
batch.map! do |pv|
|
||||
{
|
||||
index: {
|
||||
|
Loading…
Reference in New Issue
Block a user