Skip to content

Commit

Permalink
! redis indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
floere committed May 25, 2011
1 parent 7db98c8 commit 437c5f4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions server/lib/picky/index/memory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ class Memory < Base
# * result_identifier: Use if you'd like a different identifier/name in the results JSON than the name of the index.
#
def initialize name, options = {}
super name, options

options[:indexing_bundle_class] ||= Internals::Indexing::Bundle::Memory
options[:indexed_bundle_class] ||= Internals::Indexed::Bundle::Memory

super name, options
end

end
Expand Down
4 changes: 2 additions & 2 deletions server/lib/picky/index/redis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ class Redis < Base
# * result_identifier: Use if you'd like a different identifier/name in the results JSON than the name of the index.
#
def initialize name, options = {}
super name, options

options[:indexing_bundle_class] ||= Internals::Indexing::Bundle::Redis
options[:indexed_bundle_class] ||= Internals::Indexed::Bundle::Redis

super name, options
end

end
Expand Down
3 changes: 2 additions & 1 deletion server/lib/picky/internals/indexing/category.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ def initialize name, index, options = {}
weights = options[:weights] || Generators::Weights::Default
similarity = options[:similarity] || Generators::Similarity::Default

bundle_class = options[:indexing_bundle_class] || Bundle::Memory
bundle_class = index.bundle_class || Bundle::Memory

@exact = bundle_class.new(:exact, self, similarity, Generators::Partial::None.new, weights)
@partial = bundle_class.new(:partial, self, Generators::Similarity::None.new, partial, weights)
end
Expand Down
2 changes: 1 addition & 1 deletion server/test_project/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ GEM
rack_fast_escape (2009.06.24)
url_escape
rake (0.8.7)
redis (2.1.1)
redis (2.2.0)
rspec (2.5.0)
rspec-core (~> 2.5.0)
rspec-expectations (~> 2.5.0)
Expand Down
2 changes: 1 addition & 1 deletion server/test_project/app/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def initialize isbn
end

redis_index = Index::Redis.new(:redis) do
source Sources::CSV.new(:title,:author,:isbn,:year,:publisher,:subjects, file: 'data/books.csv')
source Sources::CSV.new(:title, :author, :isbn, :year, :publisher, :subjects, file: 'data/books.csv')
category :title,
qualifiers: [:t, :title, :titre],
partial: Partial::Substring.new(from: 1),
Expand Down

0 comments on commit 437c5f4

Please sign in to comment.