lib/rocket_job/sliced/slices.rb in rocketjob-4.1.0 vs lib/rocket_job/sliced/slices.rb in rocketjob-4.1.1
- old
+ new
@@ -19,10 +19,12 @@
# Default: RocketJob::Sliced::Slice
def initialize(collection_name:, slice_class: Sliced::Slice, slice_size: 100)
@slice_class = slice_class
@slice_size = slice_size
@collection_name = collection_name
- @all = slice_class.with_collection(collection_name)
+
+ # Using `Sliced::Slice` avoids having to add `_type` as an index when all slices are the same type anyway.
+ @all = Sliced::Slice.with_collection(collection_name)
end
def new(params = {})
slice_class.new(params.merge(collection_name: collection_name))
end