lib/picky/internals/indexing/category.rb in picky-2.4.2 vs lib/picky/internals/indexing/category.rb in picky-2.4.3
- old
+ new
@@ -60,10 +60,15 @@
source.respond_to?(:key_format) && source.key_format || @key_format || index.key_format
end
# The indexer is lazily generated and cached.
#
def indexer
- @indexer ||= Indexers::Serial.new self
+ @indexer ||= source.respond_to?(:each) ? Indexers::Parallel.new(self) : Indexers::Serial.new(self)
+ end
+ # TODO This is a hack to get the parallel indexer working.
+ #
+ def categories
+ [self]
end
# Returns an appropriate tokenizer.
# If one isn't set on this category, will try the index,
# and finally the default index tokenizer.
#
\ No newline at end of file