picky 3.5.4 → 3.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. data/lib/picky/backends/backend.rb +1 -1
  2. data/lib/picky/backends/file/basic.rb +0 -36
  3. data/lib/picky/backends/file/json.rb +1 -1
  4. data/lib/picky/backends/file.rb +4 -4
  5. data/lib/picky/backends/helpers/file.rb +0 -26
  6. data/lib/picky/backends/memory/basic.rb +0 -35
  7. data/lib/picky/backends/memory.rb +4 -4
  8. data/lib/picky/backends/redis/basic.rb +0 -33
  9. data/lib/picky/backends/redis.rb +4 -4
  10. data/lib/picky/backends/sqlite/db.rb +84 -0
  11. data/lib/picky/backends/sqlite.rb +75 -0
  12. data/lib/picky/bundle.rb +15 -87
  13. data/lib/picky/bundle_realtime.rb +1 -1
  14. data/lib/picky/categories.rb +1 -0
  15. data/lib/picky/categories_indexed.rb +1 -1
  16. data/lib/picky/categories_indexing.rb +1 -3
  17. data/lib/picky/category.rb +16 -2
  18. data/lib/picky/category_indexed.rb +5 -3
  19. data/lib/picky/category_indexing.rb +0 -26
  20. data/lib/picky/category_realtime.rb +2 -0
  21. data/lib/picky/extensions/string.rb +20 -0
  22. data/lib/picky/extensions/symbol.rb +22 -0
  23. data/lib/picky/generators/similarity/double_metaphone.rb +1 -2
  24. data/lib/picky/generators/similarity/metaphone.rb +1 -2
  25. data/lib/picky/generators/similarity/phonetic.rb +0 -10
  26. data/lib/picky/generators/similarity/soundex.rb +1 -2
  27. data/lib/picky/index.rb +9 -2
  28. data/lib/picky/index_indexed.rb +4 -4
  29. data/lib/picky/index_indexing.rb +1 -5
  30. data/lib/picky/indexes_indexed.rb +7 -6
  31. data/lib/picky/indexes_indexing.rb +1 -7
  32. data/lib/picky/loader.rb +4 -1
  33. data/lib/picky/sources/couch.rb +1 -1
  34. data/lib/picky/sources/mongo.rb +1 -1
  35. data/lib/picky/wrappers/bundle/calculation.rb +1 -1
  36. data/lib/picky/wrappers/bundle/exact_partial.rb +3 -12
  37. data/lib/picky/wrappers/bundle/location.rb +1 -0
  38. data/lib/tasks/index.rake +0 -4
  39. data/spec/lib/backends/file/basic_spec.rb +5 -17
  40. data/spec/lib/backends/memory/basic_spec.rb +5 -17
  41. data/spec/lib/backends/redis/basic_spec.rb +5 -52
  42. data/spec/lib/backends/sqlite/db_spec.rb +80 -0
  43. data/spec/lib/backends/sqlite_spec.rb +131 -0
  44. data/spec/lib/category_indexed_spec.rb +2 -2
  45. data/spec/lib/category_indexing_spec.rb +0 -24
  46. data/spec/lib/extensions/string_spec.rb +16 -0
  47. data/spec/lib/extensions/symbol_spec.rb +16 -0
  48. data/spec/lib/index_indexed_spec.rb +16 -16
  49. data/spec/lib/indexes_indexed_spec.rb +13 -7
  50. data/spec/lib/indexes_indexing_spec.rb +3 -6
  51. data/spec/lib/indexing/bundle_spec.rb +6 -125
  52. data/spec/lib/sources/couch_spec.rb +8 -8
  53. data/spec/lib/sources/mongo_spec.rb +5 -5
  54. data/spec/specific/realtime_spec.rb +397 -173
  55. metadata +44 -29
  56. data/lib/picky/bundling.rb +0 -10
  57. data/lib/tasks/checks.rake +0 -13
@@ -3,231 +3,455 @@
3
3
  require 'spec_helper'
4
4
 
5
5
  describe "Realtime Indexing" do
6
-
6
+
7
7
  class Book
8
8
  attr_reader :id, :title, :author
9
9
  def initialize id, title, author
10
10
  @id, @title, @author = id, title, author
11
11
  end
12
12
  end
13
-
14
- let(:index) do
15
- Picky::Index.new(:books) do
16
- source []
17
- category :title
18
- category :author, similarity: Picky::Generators::Similarity::DoubleMetaphone.new(3)
19
- end
20
- end
21
- let(:books) { Picky::Search.new index }
22
-
23
- before(:each) do
24
- index.add Book.new(1, "Title", "Author")
25
- end
26
-
27
- context 'single category updating' do
28
- it 'finds the first entry' do
29
- books.search('title:Titl').ids.should == [1]
30
- end
31
-
32
- it 'allows removing a single category and leaving the others alone' do
33
- index[:title].remove 1
34
-
35
- books.search('Title').ids.should == []
36
- books.search('Author').ids.should == [1]
37
- end
38
-
39
- it 'allows adding a single category and leaving the others alone' do
40
- index[:title].add Book.new(2, "Newtitle", "Newauthor")
41
-
42
- books.search('Title').ids.should == [1]
43
- books.search('Newtitle').ids.should == [2]
44
-
45
- books.search('Author').ids.should == [1]
46
- books.search('Newauthor').ids.should == []
47
- end
48
-
49
- it 'allows replacing a single category and leaving the others alone' do
50
- index[:title].replace Book.new(1, "Replaced", "Notindexed")
51
-
52
- books.search('Title').ids.should == []
53
- books.search('Replaced').ids.should == [1]
54
-
55
- books.search('Notindexed').ids.should == []
56
- books.search('Author').ids.should == [1]
57
- end
58
- end
59
-
60
- context 'with partial' do
61
- it 'finds the first entry' do
62
- books.search('Titl').ids.should == [1]
13
+
14
+ context 'default index' do
15
+ let(:index) do
16
+ Picky::Index.new(:books) do
17
+ source []
18
+ category :title
19
+ category :author, similarity: Picky::Generators::Similarity::DoubleMetaphone.new(3)
20
+ end
63
21
  end
22
+ let(:books) { Picky::Search.new index }
64
23
 
65
- it 'allows removing something' do
66
- index.remove 1
24
+ before(:each) do
25
+ index.add Book.new(1, "Title", "Author")
67
26
  end
68
- it 'is not findable anymore after removing' do
69
- books.search('Titl').ids.should == [1]
70
27
 
71
- index.remove 1
28
+ context 'single category updating' do
29
+ it 'finds the first entry' do
30
+ books.search('title:Titl').ids.should == [1]
31
+ end
72
32
 
73
- books.search('Titl').ids.should == []
74
- end
33
+ it 'allows removing a single category and leaving the others alone' do
34
+ index[:title].remove 1
75
35
 
76
- it 'allows adding something' do
77
- index.add Book.new(2, "Title2", "Author2")
78
- end
79
- it 'is findable after adding' do
80
- books.search('Titl').ids.should == [1]
36
+ books.search('Title').ids.should == []
37
+ books.search('Author').ids.should == [1]
38
+ end
81
39
 
82
- index.add Book.new(2, "Title New", "Author New")
40
+ it 'allows adding a single category and leaving the others alone' do
41
+ index[:title].add Book.new(2, "Newtitle", "Newauthor")
83
42
 
84
- books.search('Titl').ids.should == [2,1]
85
- end
43
+ books.search('Title').ids.should == [1]
44
+ books.search('Newtitle').ids.should == [2]
86
45
 
87
- it 'allows replacing something' do
88
- index.replace Book.new(1, "Title New", "Author New")
89
- end
90
- it 'is findable after replacing' do
91
- books.search('Ne').ids.should == []
46
+ books.search('Author').ids.should == [1]
47
+ books.search('Newauthor').ids.should == []
48
+ end
92
49
 
93
- index.replace Book.new(1, "Title New", "Author New")
50
+ it 'allows replacing a single category and leaving the others alone' do
51
+ index[:title].replace Book.new(1, "Replaced", "Notindexed")
94
52
 
95
- books.search('Ne').ids.should == [1, 1]
53
+ books.search('Title').ids.should == []
54
+ books.search('Replaced').ids.should == [1]
55
+
56
+ books.search('Notindexed').ids.should == []
57
+ books.search('Author').ids.should == [1]
58
+ end
96
59
  end
97
- it 'handles more complex cases' do
98
- books.search('Ne').ids.should == []
99
60
 
100
- index.replace Book.new(1, "Title New", "Author New")
61
+ context 'with partial' do
62
+ it 'finds the first entry' do
63
+ books.search('Titl').ids.should == [1]
64
+ end
101
65
 
102
- books.search('title:Ne').ids.should == [1]
103
- end
104
- it 'handles more complex cases' do
105
- index.remove 1
106
-
107
- books.search('Titl').ids.should == []
108
-
109
- index.replace Book.new(1, "Title New", "Author New")
110
-
111
- books.search('title:Ne').ids.should == [1]
112
- end
113
- end
114
-
115
- context 'non-partial' do
116
- it 'finds the first entry' do
117
- books.search('Titl').ids.should == [1]
118
- end
66
+ it 'allows removing something' do
67
+ index.remove 1
68
+ end
69
+ it 'is not findable anymore after removing' do
70
+ books.search('Titl').ids.should == [1]
119
71
 
120
- it 'allows removing something' do
121
- index.remove 1
122
- end
123
- it 'is not findable anymore after removing' do
124
- books.search('Titl').ids.should == [1]
72
+ index.remove 1
125
73
 
126
- index.remove 1
74
+ books.search('Titl').ids.should == []
75
+ end
127
76
 
128
- books.search('Titl').ids.should == []
129
- end
77
+ it 'allows adding something' do
78
+ index.add Book.new(2, "Title2", "Author2")
79
+ end
80
+ it 'is findable after adding' do
81
+ books.search('Titl').ids.should == [1]
130
82
 
131
- it 'allows adding something' do
132
- index.add Book.new(2, "Title2", "Author2")
133
- end
134
- it 'is findable after adding' do
135
- books.search('Titl').ids.should == [1]
83
+ index.add Book.new(2, "Title New", "Author New")
136
84
 
137
- index.add Book.new(2, "Title New", "Author New")
85
+ books.search('Titl').ids.should == [2,1]
86
+ end
138
87
 
139
- books.search('Titl').ids.should == [2,1]
140
- end
88
+ it 'allows replacing something' do
89
+ index.replace Book.new(1, "Title New", "Author New")
90
+ end
91
+ it 'is findable after replacing' do
92
+ books.search('Ne').ids.should == []
141
93
 
142
- it 'allows replacing something' do
143
- index.replace Book.new(1, "Title New", "Author New")
144
- end
145
- it 'is findable after replacing' do
146
- books.search('Ne').ids.should == []
94
+ index.replace Book.new(1, "Title New", "Author New")
95
+
96
+ books.search('Ne').ids.should == [1, 1]
97
+ end
98
+ it 'handles more complex cases' do
99
+ books.search('Ne').ids.should == []
100
+
101
+ index.replace Book.new(1, "Title New", "Author New")
102
+
103
+ books.search('title:Ne').ids.should == [1]
104
+ end
105
+ it 'handles more complex cases' do
106
+ index.remove 1
107
+
108
+ books.search('Titl').ids.should == []
147
109
 
148
- index.replace Book.new(1, "Title New", "Author New")
110
+ index.replace Book.new(1, "Title New", "Author New")
149
111
 
150
- books.search('Ne').ids.should == [1, 1]
112
+ books.search('title:Ne').ids.should == [1]
113
+ end
151
114
  end
152
- it 'handles more complex cases' do
153
- books.search('Ne').ids.should == []
154
115
 
155
- index.replace Book.new(1, "Title New", "Author New")
116
+ context 'non-partial' do
117
+ it 'finds the first entry' do
118
+ books.search('Titl').ids.should == [1]
119
+ end
156
120
 
157
- books.search('title:Ne').ids.should == [1]
121
+ it 'allows removing something' do
122
+ index.remove 1
123
+ end
124
+ it 'is not findable anymore after removing' do
125
+ books.search('Titl').ids.should == [1]
126
+
127
+ index.remove 1
128
+
129
+ books.search('Titl').ids.should == []
130
+ end
131
+
132
+ it 'allows adding something' do
133
+ index.add Book.new(2, "Title2", "Author2")
134
+ end
135
+ it 'is findable after adding' do
136
+ books.search('Titl').ids.should == [1]
137
+
138
+ index.add Book.new(2, "Title New", "Author New")
139
+
140
+ books.search('Titl').ids.should == [2,1]
141
+ end
142
+
143
+ it 'allows replacing something' do
144
+ index.replace Book.new(1, "Title New", "Author New")
145
+ end
146
+ it 'is findable after replacing' do
147
+ books.search('Ne').ids.should == []
148
+
149
+ index.replace Book.new(1, "Title New", "Author New")
150
+
151
+ books.search('Ne').ids.should == [1, 1]
152
+ end
153
+ it 'handles more complex cases' do
154
+ books.search('Ne').ids.should == []
155
+
156
+ index.replace Book.new(1, "Title New", "Author New")
157
+
158
+ books.search('title:Ne').ids.should == [1]
159
+ end
160
+ it 'handles more complex cases' do
161
+ index.remove 1
162
+
163
+ books.search('Titl').ids.should == []
164
+
165
+ index.replace Book.new(1, "Title New", "Author New")
166
+
167
+ books.search('title:Ne').ids.should == [1]
168
+ end
158
169
  end
159
- it 'handles more complex cases' do
160
- index.remove 1
161
-
162
- books.search('Titl').ids.should == []
163
-
164
- index.replace Book.new(1, "Title New", "Author New")
165
-
166
- books.search('title:Ne').ids.should == [1]
170
+
171
+ context 'similarity' do
172
+ it 'finds the first entry' do
173
+ books.search('Authr~').ids.should == [1]
174
+ end
175
+
176
+ it 'allows removing something' do
177
+ index.remove 1
178
+ end
179
+ it 'is not findable anymore after removing' do
180
+ books.search('Authr~').ids.should == [1]
181
+
182
+ index.remove 1
183
+
184
+ books.search('Authr~').ids.should == []
185
+ end
186
+
187
+ it 'allows adding something' do
188
+ index.add Book.new(2, "Title2", "Author2")
189
+ end
190
+ it 'is findable after adding' do
191
+ books.search('Authr~').ids.should == [1]
192
+
193
+ index.add Book.new(2, "Title New", "Author New")
194
+
195
+ books.search('Authr~').ids.should == [2,1]
196
+ end
197
+
198
+ it 'allows replacing something' do
199
+ index.replace Book.new(1, "Title New", "Author New")
200
+ end
201
+ it 'is findable after replacing' do
202
+ books.search('Nuw~').ids.should == []
203
+
204
+ index.replace Book.new(1, "Title New", "Author New")
205
+
206
+ books.search('Nuw~').ids.should == [1, 1] # TODO FIXME Not really what I'd expect.
207
+ end
208
+ it 'handles more complex cases' do
209
+ books.search('Now~').ids.should == []
210
+
211
+ index.replace Book.new(1, "Title New", "Author New")
212
+
213
+ books.search('author:Now~').ids.should == [1]
214
+ end
215
+ it 'handles more complex cases' do
216
+ index.remove 1
217
+
218
+ books.search('Athr~').ids.should == []
219
+
220
+ index.replace Book.new(1, "Title New", "Author New")
221
+
222
+ books.search('author:Athr~').ids.should == [1]
223
+ end
224
+ it 'handles more complex cases' do
225
+ books.search('Athr~').ids.should == [1]
226
+
227
+ index.replace Book.new(2, "Title New", "Author New")
228
+ index.add Book.new(3, "TTL", "AUTHR")
229
+
230
+ books.search('author:Athr~').ids.should == [2, 1, 3] # TODO Is that what I'd expect?
231
+ end
167
232
  end
168
233
  end
169
-
170
- context 'similarity' do
171
- it 'finds the first entry' do
172
- books.search('Authr~').ids.should == [1]
234
+
235
+ context 'special index' do
236
+ let(:index) do
237
+ Picky::Index.new(:books) do
238
+ key_format :to_sym
239
+ source []
240
+ category :title
241
+ category :author, similarity: Picky::Generators::Similarity::DoubleMetaphone.new(3)
242
+ end
173
243
  end
244
+ let(:books) { Picky::Search.new index }
174
245
 
175
- it 'allows removing something' do
176
- index.remove 1
246
+ before(:each) do
247
+ index.add Book.new("one", "Title", "Author")
177
248
  end
178
- it 'is not findable anymore after removing' do
179
- books.search('Authr~').ids.should == [1]
180
249
 
181
- index.remove 1
250
+ context 'single category updating' do
251
+ it 'finds the first entry' do
252
+ books.search('title:Titl').ids.should == [:one]
253
+ end
182
254
 
183
- books.search('Authr~').ids.should == []
184
- end
255
+ it 'allows removing a single category and leaving the others alone' do
256
+ index[:title].remove "one"
185
257
 
186
- it 'allows adding something' do
187
- index.add Book.new(2, "Title2", "Author2")
188
- end
189
- it 'is findable after adding' do
190
- books.search('Authr~').ids.should == [1]
258
+ books.search('Title').ids.should == []
259
+ books.search('Author').ids.should == [:one]
260
+ end
191
261
 
192
- index.add Book.new(2, "Title New", "Author New")
262
+ it 'allows adding a single category and leaving the others alone' do
263
+ index[:title].add Book.new("two", "Newtitle", "Newauthor")
193
264
 
194
- books.search('Authr~').ids.should == [2,1]
195
- end
265
+ books.search('Title').ids.should == [:one]
266
+ books.search('Newtitle').ids.should == [:two]
196
267
 
197
- it 'allows replacing something' do
198
- index.replace Book.new(1, "Title New", "Author New")
199
- end
200
- it 'is findable after replacing' do
201
- books.search('Nuw~').ids.should == []
268
+ books.search('Author').ids.should == [:one]
269
+ books.search('Newauthor').ids.should == []
270
+ end
271
+
272
+ it 'allows replacing a single category and leaving the others alone' do
273
+ index[:title].replace Book.new("one", "Replaced", "Notindexed")
202
274
 
203
- index.replace Book.new(1, "Title New", "Author New")
275
+ books.search('Title').ids.should == []
276
+ books.search('Replaced').ids.should == [:one]
204
277
 
205
- books.search('Nuw~').ids.should == [1, 1] # TODO FIXME Not really what I'd expect.
278
+ books.search('Notindexed').ids.should == []
279
+ books.search('Author').ids.should == [:one]
280
+ end
206
281
  end
207
- it 'handles more complex cases' do
208
- books.search('Now~').ids.should == []
209
282
 
210
- index.replace Book.new(1, "Title New", "Author New")
283
+ context 'with partial' do
284
+ it 'finds the first entry' do
285
+ books.search('Titl').ids.should == [:one]
286
+ end
287
+
288
+ it 'allows removing something' do
289
+ index.remove "one"
290
+ end
291
+ it 'is not findable anymore after removing' do
292
+ books.search('Titl').ids.should == [:one]
293
+
294
+ index.remove "one"
295
+
296
+ books.search('Titl').ids.should == []
297
+ end
298
+
299
+ it 'allows adding something' do
300
+ index.add Book.new("two", "Title2", "Author2")
301
+ end
302
+ it 'is findable after adding' do
303
+ books.search('Titl').ids.should == [:one]
304
+
305
+ index.add Book.new("two", "Title New", "Author New")
211
306
 
212
- books.search('author:Now~').ids.should == [1]
307
+ books.search('Titl').ids.should == [:two,:one]
308
+ end
309
+
310
+ it 'allows replacing something' do
311
+ index.replace Book.new("one", "Title New", "Author New")
312
+ end
313
+ it 'is findable after replacing' do
314
+ books.search('Ne').ids.should == []
315
+
316
+ index.replace Book.new("one", "Title New", "Author New")
317
+
318
+ books.search('Ne').ids.should == [:one, :one]
319
+ end
320
+ it 'handles more complex cases' do
321
+ books.search('Ne').ids.should == []
322
+
323
+ index.replace Book.new("one", "Title New", "Author New")
324
+
325
+ books.search('title:Ne').ids.should == [:one]
326
+ end
327
+ it 'handles more complex cases' do
328
+ index.remove "one"
329
+
330
+ books.search('Titl').ids.should == []
331
+
332
+ index.replace Book.new("one", "Title New", "Author New")
333
+
334
+ books.search('title:Ne').ids.should == [:one]
335
+ end
213
336
  end
214
- it 'handles more complex cases' do
215
- index.remove 1
216
-
217
- books.search('Athr~').ids.should == []
218
-
219
- index.replace Book.new(1, "Title New", "Author New")
220
-
221
- books.search('author:Athr~').ids.should == [1]
337
+
338
+ context 'non-partial' do
339
+ it 'finds the first entry' do
340
+ books.search('Titl').ids.should == [:one]
341
+ end
342
+
343
+ it 'allows removing something' do
344
+ index.remove "one"
345
+ end
346
+ it 'is not findable anymore after removing' do
347
+ books.search('Titl').ids.should == [:one]
348
+
349
+ index.remove :one
350
+
351
+ books.search('Titl').ids.should == []
352
+ end
353
+
354
+ it 'allows adding something' do
355
+ index.add Book.new("two", "Title2", "Author2")
356
+ end
357
+ it 'is findable after adding' do
358
+ books.search('Titl').ids.should == [:one]
359
+
360
+ index.add Book.new("two", "Title New", "Author New")
361
+
362
+ books.search('Titl').ids.should == [:two,:one]
363
+ end
364
+
365
+ it 'allows replacing something' do
366
+ index.replace Book.new("one", "Title New", "Author New")
367
+ end
368
+ it 'is findable after replacing' do
369
+ books.search('Ne').ids.should == []
370
+
371
+ index.replace Book.new("one", "Title New", "Author New")
372
+
373
+ books.search('Ne').ids.should == [:one, :one]
374
+ end
375
+ it 'handles more complex cases' do
376
+ books.search('Ne').ids.should == []
377
+
378
+ index.replace Book.new("one", "Title New", "Author New")
379
+
380
+ books.search('title:Ne').ids.should == [:one]
381
+ end
382
+ it 'handles more complex cases' do
383
+ index.remove "one"
384
+
385
+ books.search('Titl').ids.should == []
386
+
387
+ index.replace Book.new("one", "Title New", "Author New")
388
+
389
+ books.search('title:Ne').ids.should == [:one]
390
+ end
222
391
  end
223
- it 'handles more complex cases' do
224
- books.search('Athr~').ids.should == [1]
225
-
226
- index.replace Book.new(2, "Title New", "Author New")
227
- index.add Book.new(3, "TTL", "AUTHR")
228
392
 
229
- books.search('author:Athr~').ids.should == [2, 1, 3] # TODO Is that what I'd expect?
393
+ context 'similarity' do
394
+ it 'finds the first entry' do
395
+ books.search('Authr~').ids.should == [:one]
396
+ end
397
+
398
+ it 'allows removing something' do
399
+ index.remove "one"
400
+ end
401
+ it 'is not findable anymore after removing' do
402
+ books.search('Authr~').ids.should == [:one]
403
+
404
+ index.remove "one"
405
+
406
+ books.search('Authr~').ids.should == []
407
+ end
408
+
409
+ it 'allows adding something' do
410
+ index.add Book.new("two", "Title2", "Author2")
411
+ end
412
+ it 'is findable after adding' do
413
+ books.search('Authr~').ids.should == [:one]
414
+
415
+ index.add Book.new("two", "Title New", "Author New")
416
+
417
+ books.search('Authr~').ids.should == [:two,:one]
418
+ end
419
+
420
+ it 'allows replacing something' do
421
+ index.replace Book.new("one", "Title New", "Author New")
422
+ end
423
+ it 'is findable after replacing' do
424
+ books.search('Nuw~').ids.should == []
425
+
426
+ index.replace Book.new("one", "Title New", "Author New")
427
+
428
+ books.search('Nuw~').ids.should == [:one, :one] # TODO FIXME Not really what I'd expect.
429
+ end
430
+ it 'handles more complex cases' do
431
+ books.search('Now~').ids.should == []
432
+
433
+ index.replace Book.new("one", "Title New", "Author New")
434
+
435
+ books.search('author:Now~').ids.should == [:one]
436
+ end
437
+ it 'handles more complex cases' do
438
+ index.remove "one"
439
+
440
+ books.search('Athr~').ids.should == []
441
+
442
+ index.replace Book.new("one", "Title New", "Author New")
443
+
444
+ books.search('author:Athr~').ids.should == [:one]
445
+ end
446
+ it 'handles more complex cases' do
447
+ books.search('Athr~').ids.should == [:one]
448
+
449
+ index.replace Book.new("two", "Title New", "Author New")
450
+ index.add Book.new("three", "TTL", "AUTHR")
451
+
452
+ books.search('author:Athr~').ids.should == [:two, :one, :three] # TODO Is that what I'd expect?
453
+ end
230
454
  end
231
455
  end
232
-
456
+
233
457
  end