lib/picky/indexed/bundle/redis.rb in picky-2.7.0 vs lib/picky/indexed/bundle/redis.rb in picky-3.0.0.pre1
- old
+ new
@@ -1,84 +1,88 @@
# encoding: utf-8
#
-module Indexed # :nodoc:all
+module Picky
- #
- #
- module Bundle
+ module Indexed # :nodoc:all
- # This is the _actual_ index (based on Redis).
#
- # Handles exact/partial index, weights index, and similarity index.
#
- class Redis < Base
+ module Bundle
- def initialize name, category, *args
- super name, category, *args
-
- @backend = Backend::Redis.new name, category
- end
-
- # Get the ids for the given symbol.
+ # This is the _actual_ index (based on Redis).
#
- # Ids are an array of string values in Redis.
+ # Handles exact/partial index, weights index, and similarity index.
#
- def ids sym
- @backend.ids sym
- end
- # Get a weight for the given symbol.
- #
- # A weight is a string value in Redis. TODO Convert?
- #
- def weight sym
- @backend.weight sym
- end
- # Settings of this bundle can be accessed via [].
- #
- def [] sym
- @backend.setting sym
- end
+ class Redis < Base
- # Loads the inverted index.
- #
- def load_inverted
- # No loading needed.
- end
- # Loads the weights index.
- #
- def load_weights
- # No loading needed.
- end
- # Loads the similarity index.
- #
- def load_similarity
- # No loading needed.
- end
- # Loads the configuration.
- #
- def load_configuration
- # No loading needed.
- end
+ def initialize name, category, *args
+ super name, category, *args
- # Loads the inverted index.
- #
- def clear_inverted
- # No clearing possible, currently.
- end
- # Loads the weights index.
- #
- def clear_weights
- # No clearing possible, currently.
- end
- # Loads the similarity index.
- #
- def clear_similarity
- # No clearing possible, currently.
- end
- # Loads the configuration.
- #
- def clear_configuration
- # No clearing possible, currently.
+ @backend = Backend::Redis.new self
+ end
+
+ # Get the ids for the given symbol.
+ #
+ # Ids are an array of string values in Redis.
+ #
+ def ids sym
+ @backend.ids sym
+ end
+ # Get a weight for the given symbol.
+ #
+ # A weight is a string value in Redis.
+ #
+ def weight sym
+ @backend.weight sym
+ end
+ # Settings of this bundle can be accessed via [].
+ #
+ def [] sym
+ @backend.setting sym
+ end
+
+ # Loads the inverted index.
+ #
+ def load_inverted
+ # No loading needed.
+ end
+ # Loads the weights index.
+ #
+ def load_weights
+ # No loading needed.
+ end
+ # Loads the similarity index.
+ #
+ def load_similarity
+ # No loading needed.
+ end
+ # Loads the configuration.
+ #
+ def load_configuration
+ # No loading needed.
+ end
+
+ # Loads the inverted index.
+ #
+ def clear_inverted
+ # No clearing possible, currently.
+ end
+ # Loads the weights index.
+ #
+ def clear_weights
+ # No clearing possible, currently.
+ end
+ # Loads the similarity index.
+ #
+ def clear_similarity
+ # No clearing possible, currently.
+ end
+ # Loads the configuration.
+ #
+ def clear_configuration
+ # No clearing possible, currently.
+ end
+
end
end
end
\ No newline at end of file