Sha256: 0f9918e1a5540b7840ea513ab38622cc969294633b856b58ddb255aa3b47f93c

Contents?: true

Size: 1.87 KB

Versions: 7

Compression:

Stored size: 1.87 KB

Contents

# encoding: utf-8
#
module Picky

  module Indexed # :nodoc:all

    #
    #
    module Bundle

      # This is the _actual_ index (based on Redis).
      #
      # Handles exact/partial index, weights index, and similarity index.
      #
      class Redis < Base

        def initialize name, category, *args
          super name, category, *args

          @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

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
picky-3.0.1 lib/picky/indexed/bundle/redis.rb
picky-3.0.0 lib/picky/indexed/bundle/redis.rb
picky-3.0.0.pre5 lib/picky/indexed/bundle/redis.rb
picky-3.0.0.pre4 lib/picky/indexed/bundle/redis.rb
picky-3.0.0.pre3 lib/picky/indexed/bundle/redis.rb
picky-3.0.0.pre2 lib/picky/indexed/bundle/redis.rb
picky-3.0.0.pre1 lib/picky/indexed/bundle/redis.rb