picky 3.0.1 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. data/lib/picky/application.rb +12 -12
  2. data/lib/picky/backends/backend.rb +17 -0
  3. data/lib/picky/{backend → backends}/file/basic.rb +1 -1
  4. data/lib/picky/{backend → backends}/file/json.rb +1 -1
  5. data/lib/picky/{backend → backends}/file/marshal.rb +1 -1
  6. data/lib/picky/{backend → backends}/file/text.rb +1 -1
  7. data/lib/picky/backends/memory.rb +53 -0
  8. data/lib/picky/{backend → backends}/redis/basic.rb +9 -14
  9. data/lib/picky/backends/redis/float_hash.rb +26 -0
  10. data/lib/picky/{backend → backends}/redis/list_hash.rb +7 -11
  11. data/lib/picky/{backend → backends}/redis/string_hash.rb +7 -11
  12. data/lib/picky/backends/redis.rb +87 -0
  13. data/lib/picky/bundle.rb +107 -11
  14. data/lib/picky/category.rb +5 -5
  15. data/lib/picky/index.rb +329 -0
  16. data/lib/picky/index_indexed.rb +31 -0
  17. data/lib/picky/index_indexing.rb +161 -0
  18. data/lib/picky/indexed/bundle.rb +112 -0
  19. data/lib/picky/indexed/wrappers/exact_first.rb +1 -1
  20. data/lib/picky/indexers/parallel.rb +2 -1
  21. data/lib/picky/indexers/serial.rb +2 -1
  22. data/lib/picky/indexes_indexing.rb +1 -1
  23. data/lib/picky/indexing/bundle.rb +188 -0
  24. data/lib/picky/indexing/wrappers/category/location.rb +1 -1
  25. data/lib/picky/interfaces/live_parameters.rb +8 -8
  26. data/lib/picky/loader.rb +24 -38
  27. data/lib/picky/migrations/from_30_to_31.rb +61 -0
  28. data/lib/picky/query/allocation.rb +10 -5
  29. data/lib/picky/query/combinations.rb +70 -0
  30. data/lib/picky/query/indexes.rb +8 -7
  31. data/lib/picky/query/indexes_check.rb +47 -0
  32. data/lib/picky/query/token.rb +16 -29
  33. data/lib/picky/query/tokens.rb +4 -20
  34. data/lib/picky/search.rb +51 -58
  35. data/lib/picky/tokenizer.rb +231 -0
  36. data/lib/picky/tokenizers/location.rb +1 -1
  37. data/lib/tasks/try.rake +4 -12
  38. data/lib/tasks/try.rb +37 -0
  39. data/spec/lib/application_spec.rb +5 -5
  40. data/spec/lib/{backend → backends}/file/basic_spec.rb +2 -2
  41. data/spec/lib/{backend → backends}/file/json_spec.rb +2 -2
  42. data/spec/lib/{backend → backends}/file/marshal_spec.rb +2 -2
  43. data/spec/lib/{backend → backends}/file/text_spec.rb +1 -1
  44. data/spec/lib/backends/memory_spec.rb +77 -0
  45. data/spec/lib/{backend → backends}/redis/basic_spec.rb +19 -21
  46. data/spec/lib/backends/redis/float_hash_spec.rb +38 -0
  47. data/spec/lib/backends/redis/list_hash_spec.rb +27 -0
  48. data/spec/lib/backends/redis/string_hash_spec.rb +38 -0
  49. data/spec/lib/backends/redis_spec.rb +79 -0
  50. data/spec/lib/categories_indexed_spec.rb +3 -3
  51. data/spec/lib/category_indexed_spec.rb +6 -6
  52. data/spec/lib/category_indexing_spec.rb +1 -1
  53. data/spec/lib/category_spec.rb +1 -1
  54. data/spec/lib/frontend_adapters/rack_spec.rb +2 -2
  55. data/spec/lib/{indexes/index_indexed_spec.rb → index_indexed_spec.rb} +1 -1
  56. data/spec/lib/{indexes/index_indexing_spec.rb → index_indexing_spec.rb} +1 -1
  57. data/spec/lib/{indexes/index_spec.rb → index_spec.rb} +1 -1
  58. data/spec/lib/indexed/{bundle/memory_spec.rb → memory_spec.rb} +18 -18
  59. data/spec/lib/indexed/wrappers/exact_first_spec.rb +2 -2
  60. data/spec/lib/indexing/{bundle/memory_partial_generation_speed_spec.rb → bundle_partial_generation_speed_spec.rb} +3 -3
  61. data/spec/lib/indexing/bundle_spec.rb +302 -0
  62. data/spec/lib/query/allocation_spec.rb +21 -11
  63. data/spec/lib/query/combination_spec.rb +2 -2
  64. data/spec/lib/query/{combinations/base_spec.rb → combinations_spec.rb} +1 -1
  65. data/spec/lib/query/indexes_check_spec.rb +25 -0
  66. data/spec/lib/query/indexes_spec.rb +5 -1
  67. data/spec/lib/query/token_spec.rb +18 -20
  68. data/spec/lib/query/tokens_spec.rb +14 -65
  69. data/spec/lib/search_spec.rb +36 -37
  70. data/spec/lib/tasks/try_spec.rb +51 -0
  71. data/spec/lib/{tokenizers/base_spec.rb → tokenizer_spec.rb} +15 -44
  72. metadata +64 -81
  73. data/lib/picky/backend/base.rb +0 -121
  74. data/lib/picky/backend/files.rb +0 -28
  75. data/lib/picky/backend/redis.rb +0 -44
  76. data/lib/picky/indexed/bundle/base.rb +0 -47
  77. data/lib/picky/indexed/bundle/memory.rb +0 -88
  78. data/lib/picky/indexed/bundle/redis.rb +0 -91
  79. data/lib/picky/indexes/index.rb +0 -328
  80. data/lib/picky/indexes/index_indexed.rb +0 -35
  81. data/lib/picky/indexes/index_indexing.rb +0 -165
  82. data/lib/picky/indexes/memory.rb +0 -20
  83. data/lib/picky/indexes/redis.rb +0 -20
  84. data/lib/picky/indexing/bundle/base.rb +0 -242
  85. data/lib/picky/indexing/bundle/memory.rb +0 -26
  86. data/lib/picky/indexing/bundle/redis.rb +0 -26
  87. data/lib/picky/query/combinations/base.rb +0 -74
  88. data/lib/picky/query/combinations/memory.rb +0 -52
  89. data/lib/picky/query/combinations/redis.rb +0 -90
  90. data/lib/picky/query.rb +0 -6
  91. data/lib/picky/tokenizers/base.rb +0 -231
  92. data/lib/picky/tokenizers/index.rb +0 -34
  93. data/lib/picky/tokenizers/query.rb +0 -61
  94. data/spec/lib/backend/files_spec.rb +0 -189
  95. data/spec/lib/backend/redis/list_hash_spec.rb +0 -40
  96. data/spec/lib/backend/redis/string_hash_spec.rb +0 -47
  97. data/spec/lib/backend/redis_spec.rb +0 -170
  98. data/spec/lib/indexed/bundle/redis_spec.rb +0 -41
  99. data/spec/lib/indexes/redis_spec.rb +0 -15
  100. data/spec/lib/indexing/bundle/base_spec.rb +0 -38
  101. data/spec/lib/indexing/bundle/memory_spec.rb +0 -287
  102. data/spec/lib/indexing/bundle/redis_spec.rb +0 -283
  103. data/spec/lib/query/combinations/memory_spec.rb +0 -158
  104. data/spec/lib/query/combinations/redis_spec.rb +0 -172
  105. data/spec/lib/tokenizers/index_spec.rb +0 -69
  106. data/spec/lib/tokenizers/query_spec.rb +0 -121
@@ -14,71 +14,20 @@ describe Picky::Query::Tokens do
14
14
 
15
15
  described_class.should_receive(:new).once.with expected
16
16
 
17
- described_class.processed ['this~', 'is', 'a', 'sp:solr', 'query"']
17
+ described_class.processed ['this~', 'is', 'a', 'sp:solr', 'query"'], []
18
18
  end
19
19
  it 'generates processed tokens from all words' do
20
20
  expected = [
21
- Picky::Query::Token.processed('this~', false),
22
- Picky::Query::Token.processed('is', false),
23
- Picky::Query::Token.processed('a', false),
24
- Picky::Query::Token.processed('sp:solr', false),
25
- Picky::Query::Token.processed('query"', false)
21
+ Picky::Query::Token.processed('this~'),
22
+ Picky::Query::Token.processed('is'),
23
+ Picky::Query::Token.processed('a'),
24
+ Picky::Query::Token.processed('sp:solr'),
25
+ Picky::Query::Token.processed('query"')
26
26
  ]
27
27
 
28
28
  described_class.should_receive(:new).once.with expected
29
29
 
30
- described_class.processed ['this~', 'is', 'a', 'sp:solr', 'query"']
31
- end
32
- end
33
-
34
- describe 'reject' do
35
- before(:each) do
36
- @blank = stub :blank, :blank? => true
37
- @nonblank = stub :nonblank, :blank? => false
38
- @tokens = described_class.new [@blank, @nonblank, @blank, @blank, @nonblank]
39
- end
40
- it 'should not cut it down' do
41
- @tokens.reject
42
-
43
- @tokens.instance_variable_get(:@tokens).should == [@nonblank, @nonblank]
44
- end
45
- end
46
-
47
- describe 'cap' do
48
- context 'one token' do
49
- before(:each) do
50
- @token = Picky::Query::Token.processed 'Token'
51
- @tokens = described_class.new [@token]
52
- end
53
- it 'does not cut it down' do
54
- @tokens.cap 5
55
-
56
- @tokens.instance_variable_get(:@tokens).should == [@token]
57
- end
58
- it 'cuts it down' do
59
- @tokens.cap 0
60
-
61
- @tokens.instance_variable_get(:@tokens).should == []
62
- end
63
- end
64
- context 'many tokens' do
65
- before(:each) do
66
- @first = Picky::Query::Token.processed 'Hello'
67
- @second = Picky::Query::Token.processed 'I'
68
- @third = Picky::Query::Token.processed 'Am'
69
- @tokens = described_class.new [
70
- @first,
71
- @second,
72
- @third,
73
- Picky::Query::Token.processed('A'),
74
- Picky::Query::Token.processed('Token')
75
- ]
76
- end
77
- it 'should cap the number of tokens' do
78
- @tokens.cap 3
79
-
80
- @tokens.instance_variable_get(:@tokens).should == [@first, @second, @third]
81
- end
30
+ described_class.processed ['this~', 'is', 'a', 'sp:solr', 'query"'], []
82
31
  end
83
32
  end
84
33
 
@@ -113,8 +62,8 @@ describe Picky::Query::Tokens do
113
62
  end
114
63
  context 'many tokens' do
115
64
  before(:each) do
116
- @first = Picky::Query::Token.processed 'Hello'
117
- @last = Picky::Query::Token.processed 'Token'
65
+ @first = Picky::Query::Token.processed 'Hello', 'HELLO'
66
+ @last = Picky::Query::Token.processed 'Token', 'TOKEN'
118
67
  @tokens = described_class.new [
119
68
  @first,
120
69
  Picky::Query::Token.processed('I'),
@@ -173,11 +122,11 @@ describe Picky::Query::Tokens do
173
122
  describe 'to_s' do
174
123
  before(:each) do
175
124
  @tokens = described_class.new [
176
- Picky::Query::Token.processed('Hello~'),
177
- Picky::Query::Token.processed('I~'),
178
- Picky::Query::Token.processed('Am'),
179
- Picky::Query::Token.processed('A*'),
180
- Picky::Query::Token.processed('Token~')
125
+ Picky::Query::Token.processed('hello~', 'Hello~'),
126
+ Picky::Query::Token.processed('i~', 'I~'),
127
+ Picky::Query::Token.processed('am', 'Am'),
128
+ Picky::Query::Token.processed('a*', 'A*'),
129
+ Picky::Query::Token.processed('token~', 'Token~')
181
130
  ]
182
131
  end
183
132
  it 'should work correctly' do
@@ -6,7 +6,10 @@ describe Picky::Search do
6
6
 
7
7
  before(:each) do
8
8
  @type = stub :type
9
- @index = stub :some_index, :internal_indexed => @type, :each_category => []
9
+ @index = stub :some_index,
10
+ :internal_indexed => @type,
11
+ :each_category => [],
12
+ :backend => Picky::Backends::Memory.new
10
13
  end
11
14
 
12
15
  describe 'tokenized' do
@@ -15,7 +18,7 @@ describe Picky::Search do
15
18
  tokenizer = stub :tokenizer
16
19
  search.stub! :tokenizer => tokenizer
17
20
 
18
- tokenizer.should_receive(:tokenize).once.with :some_text
21
+ tokenizer.should_receive(:tokenize).once.with(:some_text).and_return [['some_text'], [:some_original]]
19
22
 
20
23
  search.tokenized :some_text
21
24
  end
@@ -37,7 +40,7 @@ describe Picky::Search do
37
40
  context 'no tokenizer predefined' do
38
41
  let(:search) { described_class.new }
39
42
  it 'returns the default tokenizer' do
40
- search.tokenizer.should == Picky::Tokenizers::Query.default
43
+ search.tokenizer.should == Picky::Tokenizer.query_default
41
44
  end
42
45
  end
43
46
  context 'tokenizer predefined' do
@@ -52,34 +55,6 @@ describe Picky::Search do
52
55
 
53
56
  end
54
57
 
55
- describe 'combinations_type_for' do
56
- let(:search) { described_class.new }
57
- it 'returns a specific Combination for a specific input' do
58
- some_source = stub(:source, :harvest => nil)
59
- search.combinations_type_for([
60
- Picky::Indexes::Memory.new(:gu) do
61
- source some_source
62
- end]
63
- ).should == Picky::Query::Combinations::Memory
64
- end
65
- it 'just works on the same types' do
66
- search.combinations_type_for([:blorf, :blarf]).should == Picky::Query::Combinations::Memory
67
- end
68
- it 'just uses standard combinations' do
69
- search.combinations_type_for([:blorf]).should == Picky::Query::Combinations::Memory
70
- end
71
- it 'raises on multiple types' do
72
- expect do
73
- search.combinations_type_for [:blorf, "blarf"]
74
- end.to raise_error(Picky::Search::DifferentTypesError)
75
- end
76
- it 'raises with the right message on multiple types' do
77
- expect do
78
- search.combinations_type_for [:blorf, "blarf"]
79
- end.to raise_error("Currently it isn't possible to mix Symbol and String Indexes in the same Search instance.")
80
- end
81
- end
82
-
83
58
  describe "weights handling" do
84
59
  it "creates a default weight when no weights are given" do
85
60
  search = described_class.new
@@ -128,13 +103,13 @@ describe Picky::Search do
128
103
  describe 'initializer' do
129
104
  context 'with tokenizer' do
130
105
  before(:each) do
131
- tokenizer = stub :tokenizer, :tokenize => :some_tokenized_text
106
+ tokenizer = stub :tokenizer, :tokenize => [['some_text'], ['some_original']]
132
107
  @search = described_class.new @index do
133
108
  searching tokenizer
134
109
  end
135
110
  end
136
- it 'should tokenize using the tokenizer' do
137
- @search.tokenized('some text').should == :some_tokenized_text
111
+ it 'should return Tokens' do
112
+ @search.tokenized('some text').should be_kind_of(Picky::Query::Tokens)
138
113
  end
139
114
  end
140
115
  end
@@ -143,12 +118,36 @@ describe Picky::Search do
143
118
  before(:each) do
144
119
  @index.stub! :name => :some_index, :each_category => []
145
120
  end
121
+ context 'without indexes' do
122
+ before(:each) do
123
+ @search = described_class.new
124
+ end
125
+ it 'works correctly' do
126
+ @search.to_s.should == 'Picky::Search(weights: Picky::Query::Weights({}))'
127
+ end
128
+ end
146
129
  context 'with weights' do
147
130
  before(:each) do
148
- @search = described_class.new @index do boost :some_weights end
131
+ @search = described_class.new @index do boost [:a, :b] => +3 end
132
+ end
133
+ it 'works correctly' do
134
+ @search.to_s.should == 'Picky::Search(some_index, weights: Picky::Query::Weights({[:a, :b]=>3}))'
135
+ end
136
+ end
137
+ context 'with special weights' do
138
+ before(:each) do
139
+ class RandomWeights
140
+ def score_for combinations
141
+ rand
142
+ end
143
+ def to_s
144
+ "#{self.class}(rand)"
145
+ end
146
+ end
147
+ @search = described_class.new @index do boost RandomWeights.new end
149
148
  end
150
149
  it 'works correctly' do
151
- @search.to_s.should == 'Picky::Search(some_index, weights: some_weights)'
150
+ @search.to_s.should == 'Picky::Search(some_index, weights: RandomWeights(rand))'
152
151
  end
153
152
  end
154
153
  context 'without weights' do
@@ -156,7 +155,7 @@ describe Picky::Search do
156
155
  @search = described_class.new @index
157
156
  end
158
157
  it 'works correctly' do
159
- @search.to_s.should == 'Picky::Search(some_index)'
158
+ @search.to_s.should == 'Picky::Search(some_index, weights: Picky::Query::Weights({}))'
160
159
  end
161
160
  end
162
161
  end
@@ -0,0 +1,51 @@
1
+ # encoding: utf-8
2
+ #
3
+ require 'spec_helper'
4
+
5
+ # We need to load the Statistics file explicitly as the Statistics
6
+ # are not loaded with the Loader (not needed in the server, only for script runs).
7
+ #
8
+ require File.expand_path '../../../../lib/tasks/try', __FILE__
9
+
10
+ describe Picky::Try do
11
+
12
+ context 'with text' do
13
+ let(:try) { described_class.new 'text' }
14
+ it 'is saved correctly' do
15
+ try.saved.should == ['text']
16
+ end
17
+ it 'is searched correctly' do
18
+ try.searched.should == ['text']
19
+ end
20
+ end
21
+
22
+ context 'with text and index' do
23
+ before(:each) do
24
+ Picky::Indexes.register Picky::Index.new(:index)
25
+ end
26
+ let(:try) { described_class.new 'text', 'index' }
27
+ it 'is saved correctly' do
28
+ try.saved.should == ['text']
29
+ end
30
+ it 'is searched correctly' do
31
+ try.searched.should == ['text']
32
+ end
33
+ end
34
+
35
+ context 'with text and index and category' do
36
+ before(:each) do
37
+ index = Picky::Index.new(:index) do
38
+ category :category
39
+ end
40
+ Picky::Indexes.register index
41
+ end
42
+ let(:try) { described_class.new 'text', 'index', 'category' }
43
+ it 'is saved correctly' do
44
+ try.saved.should == ['text']
45
+ end
46
+ it 'is searched correctly' do
47
+ try.searched.should == ['text']
48
+ end
49
+ end
50
+
51
+ end
@@ -2,7 +2,7 @@
2
2
  #
3
3
  require 'spec_helper'
4
4
 
5
- describe Picky::Tokenizers::Base do
5
+ describe Picky::Tokenizer do
6
6
 
7
7
  context 'with special instance' do
8
8
  let (:tokenizer) { described_class.new rejects_token_if: lambda { |token| token.to_s.length < 2 || token == :hello }, case_sensitive: true }
@@ -15,14 +15,13 @@ describe Picky::Tokenizers::Base do
15
15
  describe 'to_s' do
16
16
  it 'spits out the right text' do
17
17
  tokenizer.to_s.should == <<-EXPECTED
18
- Removes characters: -
19
- Stopwords: -
20
- Splits text on: /\\s/
21
- Removes chars after split: -
22
- Normalizes words: -
23
- Rejects tokens? Yes, see line 8 in app/application.rb
24
- Substitutes chars? -
25
- Case sensitive? Yes.
18
+ Removes characters: -
19
+ Stopwords: -
20
+ Splits text on: /\\s/
21
+ Normalizes words: -
22
+ Rejects tokens? Yes, see line 8 in app/application.rb
23
+ Substitutes chars? -
24
+ Case sensitive? Yes.
26
25
  EXPECTED
27
26
  end
28
27
  end
@@ -34,14 +33,13 @@ EXPECTED
34
33
  describe 'to_s' do
35
34
  it 'spits out the right text' do
36
35
  tokenizer.to_s.should == <<-EXPECTED
37
- Removes characters: -
38
- Stopwords: -
39
- Splits text on: /\\s/
40
- Removes chars after split: -
41
- Normalizes words: -
42
- Rejects tokens? -
43
- Substitutes chars? -
44
- Case sensitive? -
36
+ Removes characters: -
37
+ Stopwords: -
38
+ Splits text on: /\\s/
39
+ Normalizes words: -
40
+ Rejects tokens? -
41
+ Substitutes chars? -
42
+ Case sensitive? -
45
43
  EXPECTED
46
44
  end
47
45
  end
@@ -76,33 +74,6 @@ EXPECTED
76
74
  end
77
75
  end
78
76
 
79
- describe "removes_characters_after_splitting" do
80
- it 'handles broken arguments' do
81
- expect { tokenizer.removes_characters_after_splitting("gnorf") }.to raise_error(ArgumentError)
82
- end
83
- context "without removes_characters_after_splitting called" do
84
- it "has remove_after_normalizing_illegals" do
85
- expect { tokenizer.remove_after_normalizing_illegals('any') }.to_not raise_error
86
- end
87
- it 'should define a remove_after_normalizing_illegals normalize_with_patterns does nothing' do
88
- unchanging = stub :unchanging
89
-
90
- tokenizer.remove_after_normalizing_illegals unchanging
91
- end
92
- end
93
- context "with removes_characters_after_splitting called" do
94
- before(:each) do
95
- tokenizer.removes_characters_after_splitting(/[afo]/)
96
- end
97
- it "has remove_after_normalizing_illegals" do
98
- expect { tokenizer.remove_after_normalizing_illegals('abcdefghijklmnop') }.to_not raise_error
99
- end
100
- it "removes illegal characters" do
101
- tokenizer.remove_after_normalizing_illegals('abcdefghijklmnop').should == 'bcdeghijklmnp'
102
- end
103
- end
104
- end
105
-
106
77
  describe "normalizes_words" do
107
78
  it 'handles broken arguments' do
108
79
  expect { tokenizer.normalizes_words(:not_an_array) }.to raise_error(ArgumentError)
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: picky
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 3.0.1
5
+ version: 3.1.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Florian Hanke
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-08-17 00:00:00 +10:00
13
+ date: 2011-08-26 00:00:00 +10:00
14
14
  default_executable: picky
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -32,7 +32,7 @@ dependencies:
32
32
  requirements:
33
33
  - - "="
34
34
  - !ruby/object:Gem::Version
35
- version: 3.0.1
35
+ version: 3.1.0
36
36
  type: :development
37
37
  version_requirements: *id002
38
38
  description: Fast Ruby semantic text search engine with comfortable single field interface.
@@ -51,16 +51,17 @@ files:
51
51
  - lib/picky/adapters/rack.rb
52
52
  - lib/picky/analyzer.rb
53
53
  - lib/picky/application.rb
54
- - lib/picky/backend/base.rb
55
- - lib/picky/backend/file/basic.rb
56
- - lib/picky/backend/file/json.rb
57
- - lib/picky/backend/file/marshal.rb
58
- - lib/picky/backend/file/text.rb
59
- - lib/picky/backend/files.rb
60
- - lib/picky/backend/redis/basic.rb
61
- - lib/picky/backend/redis/list_hash.rb
62
- - lib/picky/backend/redis/string_hash.rb
63
- - lib/picky/backend/redis.rb
54
+ - lib/picky/backends/backend.rb
55
+ - lib/picky/backends/file/basic.rb
56
+ - lib/picky/backends/file/json.rb
57
+ - lib/picky/backends/file/marshal.rb
58
+ - lib/picky/backends/file/text.rb
59
+ - lib/picky/backends/memory.rb
60
+ - lib/picky/backends/redis/basic.rb
61
+ - lib/picky/backends/redis/float_hash.rb
62
+ - lib/picky/backends/redis/list_hash.rb
63
+ - lib/picky/backends/redis/string_hash.rb
64
+ - lib/picky/backends/redis.rb
64
65
  - lib/picky/bundle.rb
65
66
  - lib/picky/bundling.rb
66
67
  - lib/picky/calculations/location.rb
@@ -104,9 +105,10 @@ files:
104
105
  - lib/picky/generators/weights/strategy.rb
105
106
  - lib/picky/generators/weights_generator.rb
106
107
  - lib/picky/helpers/measuring.rb
107
- - lib/picky/indexed/bundle/base.rb
108
- - lib/picky/indexed/bundle/memory.rb
109
- - lib/picky/indexed/bundle/redis.rb
108
+ - lib/picky/index.rb
109
+ - lib/picky/index_indexed.rb
110
+ - lib/picky/index_indexing.rb
111
+ - lib/picky/indexed/bundle.rb
110
112
  - lib/picky/indexed/wrappers/bundle/calculation.rb
111
113
  - lib/picky/indexed/wrappers/bundle/location.rb
112
114
  - lib/picky/indexed/wrappers/bundle/wrapper.rb
@@ -115,34 +117,26 @@ files:
115
117
  - lib/picky/indexers/base.rb
116
118
  - lib/picky/indexers/parallel.rb
117
119
  - lib/picky/indexers/serial.rb
118
- - lib/picky/indexes/index.rb
119
- - lib/picky/indexes/index_indexed.rb
120
- - lib/picky/indexes/index_indexing.rb
121
- - lib/picky/indexes/memory.rb
122
- - lib/picky/indexes/redis.rb
123
120
  - lib/picky/indexes.rb
124
121
  - lib/picky/indexes_indexed.rb
125
122
  - lib/picky/indexes_indexing.rb
126
- - lib/picky/indexing/bundle/base.rb
127
- - lib/picky/indexing/bundle/memory.rb
128
- - lib/picky/indexing/bundle/redis.rb
123
+ - lib/picky/indexing/bundle.rb
129
124
  - lib/picky/indexing/wrappers/category/location.rb
130
125
  - lib/picky/interfaces/live_parameters.rb
131
126
  - lib/picky/loader.rb
127
+ - lib/picky/migrations/from_30_to_31.rb
132
128
  - lib/picky/no_source_specified_exception.rb
133
129
  - lib/picky/performant.rb
134
130
  - lib/picky/query/allocation.rb
135
131
  - lib/picky/query/allocations.rb
136
132
  - lib/picky/query/combination.rb
137
- - lib/picky/query/combinations/base.rb
138
- - lib/picky/query/combinations/memory.rb
139
- - lib/picky/query/combinations/redis.rb
133
+ - lib/picky/query/combinations.rb
140
134
  - lib/picky/query/indexes.rb
135
+ - lib/picky/query/indexes_check.rb
141
136
  - lib/picky/query/qualifier_category_mapper.rb
142
137
  - lib/picky/query/token.rb
143
138
  - lib/picky/query/tokens.rb
144
139
  - lib/picky/query/weights.rb
145
- - lib/picky/query.rb
146
140
  - lib/picky/rack/harakiri.rb
147
141
  - lib/picky/results.rb
148
142
  - lib/picky/search.rb
@@ -157,11 +151,10 @@ files:
157
151
  - lib/picky/sources/wrappers/location.rb
158
152
  - lib/picky/statistics.rb
159
153
  - lib/picky/tasks.rb
160
- - lib/picky/tokenizers/base.rb
161
- - lib/picky/tokenizers/index.rb
154
+ - lib/picky/tokenizer.rb
162
155
  - lib/picky/tokenizers/location.rb
163
- - lib/picky/tokenizers/query.rb
164
156
  - lib/picky.rb
157
+ - lib/tasks/try.rb
165
158
  - lib/tasks/application.rake
166
159
  - lib/tasks/checks.rake
167
160
  - lib/tasks/framework.rake
@@ -179,15 +172,16 @@ files:
179
172
  - spec/lib/adapters/rack/query_spec.rb
180
173
  - spec/lib/analyzer_spec.rb
181
174
  - spec/lib/application_spec.rb
182
- - spec/lib/backend/file/basic_spec.rb
183
- - spec/lib/backend/file/json_spec.rb
184
- - spec/lib/backend/file/marshal_spec.rb
185
- - spec/lib/backend/file/text_spec.rb
186
- - spec/lib/backend/files_spec.rb
187
- - spec/lib/backend/redis/basic_spec.rb
188
- - spec/lib/backend/redis/list_hash_spec.rb
189
- - spec/lib/backend/redis/string_hash_spec.rb
190
- - spec/lib/backend/redis_spec.rb
175
+ - spec/lib/backends/file/basic_spec.rb
176
+ - spec/lib/backends/file/json_spec.rb
177
+ - spec/lib/backends/file/marshal_spec.rb
178
+ - spec/lib/backends/file/text_spec.rb
179
+ - spec/lib/backends/memory_spec.rb
180
+ - spec/lib/backends/redis/basic_spec.rb
181
+ - spec/lib/backends/redis/float_hash_spec.rb
182
+ - spec/lib/backends/redis/list_hash_spec.rb
183
+ - spec/lib/backends/redis/string_hash_spec.rb
184
+ - spec/lib/backends/redis_spec.rb
191
185
  - spec/lib/bundling_spec.rb
192
186
  - spec/lib/calculations/location_spec.rb
193
187
  - spec/lib/categories_indexed_spec.rb
@@ -217,34 +211,29 @@ files:
217
211
  - spec/lib/generators/weights/logarithmic_spec.rb
218
212
  - spec/lib/generators/weights_generator_spec.rb
219
213
  - spec/lib/helpers/measuring_spec.rb
220
- - spec/lib/indexed/bundle/memory_spec.rb
221
- - spec/lib/indexed/bundle/redis_spec.rb
214
+ - spec/lib/index_indexed_spec.rb
215
+ - spec/lib/index_indexing_spec.rb
216
+ - spec/lib/index_spec.rb
217
+ - spec/lib/indexed/memory_spec.rb
222
218
  - spec/lib/indexed/wrappers/bundle/calculation_spec.rb
223
219
  - spec/lib/indexed/wrappers/bundle/wrapper_spec.rb
224
220
  - spec/lib/indexed/wrappers/exact_first_spec.rb
225
221
  - spec/lib/indexers/base_spec.rb
226
222
  - spec/lib/indexers/parallel_spec.rb
227
223
  - spec/lib/indexers/serial_spec.rb
228
- - spec/lib/indexes/index_indexed_spec.rb
229
- - spec/lib/indexes/index_indexing_spec.rb
230
- - spec/lib/indexes/index_spec.rb
231
- - spec/lib/indexes/redis_spec.rb
232
224
  - spec/lib/indexes_class_spec.rb
233
225
  - spec/lib/indexes_indexed_spec.rb
234
226
  - spec/lib/indexes_indexing_spec.rb
235
227
  - spec/lib/indexes_spec.rb
236
- - spec/lib/indexing/bundle/base_spec.rb
237
- - spec/lib/indexing/bundle/memory_partial_generation_speed_spec.rb
238
- - spec/lib/indexing/bundle/memory_spec.rb
239
- - spec/lib/indexing/bundle/redis_spec.rb
228
+ - spec/lib/indexing/bundle_partial_generation_speed_spec.rb
229
+ - spec/lib/indexing/bundle_spec.rb
240
230
  - spec/lib/interfaces/live_parameters_spec.rb
241
231
  - spec/lib/loader_spec.rb
242
232
  - spec/lib/query/allocation_spec.rb
243
233
  - spec/lib/query/allocations_spec.rb
244
234
  - spec/lib/query/combination_spec.rb
245
- - spec/lib/query/combinations/base_spec.rb
246
- - spec/lib/query/combinations/memory_spec.rb
247
- - spec/lib/query/combinations/redis_spec.rb
235
+ - spec/lib/query/combinations_spec.rb
236
+ - spec/lib/query/indexes_check_spec.rb
248
237
  - spec/lib/query/indexes_spec.rb
249
238
  - spec/lib/query/qualifier_category_mapper_spec.rb
250
239
  - spec/lib/query/solr_spec.rb
@@ -265,9 +254,8 @@ files:
265
254
  - spec/lib/sources/wrappers/base_spec.rb
266
255
  - spec/lib/sources/wrappers/location_spec.rb
267
256
  - spec/lib/statistics_spec.rb
268
- - spec/lib/tokenizers/base_spec.rb
269
- - spec/lib/tokenizers/index_spec.rb
270
- - spec/lib/tokenizers/query_spec.rb
257
+ - spec/lib/tasks/try_spec.rb
258
+ - spec/lib/tokenizer_spec.rb
271
259
  - spec/specific/speed_spec.rb
272
260
  - bin/picky
273
261
  has_rdoc: true
@@ -306,15 +294,16 @@ test_files:
306
294
  - spec/lib/adapters/rack/query_spec.rb
307
295
  - spec/lib/analyzer_spec.rb
308
296
  - spec/lib/application_spec.rb
309
- - spec/lib/backend/file/basic_spec.rb
310
- - spec/lib/backend/file/json_spec.rb
311
- - spec/lib/backend/file/marshal_spec.rb
312
- - spec/lib/backend/file/text_spec.rb
313
- - spec/lib/backend/files_spec.rb
314
- - spec/lib/backend/redis/basic_spec.rb
315
- - spec/lib/backend/redis/list_hash_spec.rb
316
- - spec/lib/backend/redis/string_hash_spec.rb
317
- - spec/lib/backend/redis_spec.rb
297
+ - spec/lib/backends/file/basic_spec.rb
298
+ - spec/lib/backends/file/json_spec.rb
299
+ - spec/lib/backends/file/marshal_spec.rb
300
+ - spec/lib/backends/file/text_spec.rb
301
+ - spec/lib/backends/memory_spec.rb
302
+ - spec/lib/backends/redis/basic_spec.rb
303
+ - spec/lib/backends/redis/float_hash_spec.rb
304
+ - spec/lib/backends/redis/list_hash_spec.rb
305
+ - spec/lib/backends/redis/string_hash_spec.rb
306
+ - spec/lib/backends/redis_spec.rb
318
307
  - spec/lib/bundling_spec.rb
319
308
  - spec/lib/calculations/location_spec.rb
320
309
  - spec/lib/categories_indexed_spec.rb
@@ -344,34 +333,29 @@ test_files:
344
333
  - spec/lib/generators/weights/logarithmic_spec.rb
345
334
  - spec/lib/generators/weights_generator_spec.rb
346
335
  - spec/lib/helpers/measuring_spec.rb
347
- - spec/lib/indexed/bundle/memory_spec.rb
348
- - spec/lib/indexed/bundle/redis_spec.rb
336
+ - spec/lib/index_indexed_spec.rb
337
+ - spec/lib/index_indexing_spec.rb
338
+ - spec/lib/index_spec.rb
339
+ - spec/lib/indexed/memory_spec.rb
349
340
  - spec/lib/indexed/wrappers/bundle/calculation_spec.rb
350
341
  - spec/lib/indexed/wrappers/bundle/wrapper_spec.rb
351
342
  - spec/lib/indexed/wrappers/exact_first_spec.rb
352
343
  - spec/lib/indexers/base_spec.rb
353
344
  - spec/lib/indexers/parallel_spec.rb
354
345
  - spec/lib/indexers/serial_spec.rb
355
- - spec/lib/indexes/index_indexed_spec.rb
356
- - spec/lib/indexes/index_indexing_spec.rb
357
- - spec/lib/indexes/index_spec.rb
358
- - spec/lib/indexes/redis_spec.rb
359
346
  - spec/lib/indexes_class_spec.rb
360
347
  - spec/lib/indexes_indexed_spec.rb
361
348
  - spec/lib/indexes_indexing_spec.rb
362
349
  - spec/lib/indexes_spec.rb
363
- - spec/lib/indexing/bundle/base_spec.rb
364
- - spec/lib/indexing/bundle/memory_partial_generation_speed_spec.rb
365
- - spec/lib/indexing/bundle/memory_spec.rb
366
- - spec/lib/indexing/bundle/redis_spec.rb
350
+ - spec/lib/indexing/bundle_partial_generation_speed_spec.rb
351
+ - spec/lib/indexing/bundle_spec.rb
367
352
  - spec/lib/interfaces/live_parameters_spec.rb
368
353
  - spec/lib/loader_spec.rb
369
354
  - spec/lib/query/allocation_spec.rb
370
355
  - spec/lib/query/allocations_spec.rb
371
356
  - spec/lib/query/combination_spec.rb
372
- - spec/lib/query/combinations/base_spec.rb
373
- - spec/lib/query/combinations/memory_spec.rb
374
- - spec/lib/query/combinations/redis_spec.rb
357
+ - spec/lib/query/combinations_spec.rb
358
+ - spec/lib/query/indexes_check_spec.rb
375
359
  - spec/lib/query/indexes_spec.rb
376
360
  - spec/lib/query/qualifier_category_mapper_spec.rb
377
361
  - spec/lib/query/solr_spec.rb
@@ -392,7 +376,6 @@ test_files:
392
376
  - spec/lib/sources/wrappers/base_spec.rb
393
377
  - spec/lib/sources/wrappers/location_spec.rb
394
378
  - spec/lib/statistics_spec.rb
395
- - spec/lib/tokenizers/base_spec.rb
396
- - spec/lib/tokenizers/index_spec.rb
397
- - spec/lib/tokenizers/query_spec.rb
379
+ - spec/lib/tasks/try_spec.rb
380
+ - spec/lib/tokenizer_spec.rb
398
381
  - spec/specific/speed_spec.rb