picky 4.25.1 → 4.25.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/picky/query/or.rb +4 -0
- data/spec/functional/or_spec.rb +22 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65f4506b046ad69ea906941acd6e3119f3ecf30e
|
4
|
+
data.tar.gz: 4fa9054087a65a94e94e1ecf8f76af34bc30e876
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ee957602ea8399d207212162c2d8865cd3cd34f390832abfd92eed9d4a36d92f59bc8cd56b2c8e0feba975fe61a962a46236e56b6f793b24dbf63ffc86ddbbe
|
7
|
+
data.tar.gz: 572ac5d023808273e7300dfce25ed79c2e675cc360099801f834a4d2a2f7fec7b9778f88dd7f54218cf9e2c487c0bf8e97c05c3e8dc29cbbe2ce450b72693f2e
|
data/lib/picky/query/or.rb
CHANGED
data/spec/functional/or_spec.rb
CHANGED
@@ -29,6 +29,28 @@ describe "OR token" do
|
|
29
29
|
it('still works') { try.search("hello text:ohai").ids.should == [1] }
|
30
30
|
end
|
31
31
|
|
32
|
+
context 'simple cases with symbol_keys' do
|
33
|
+
let(:index) do
|
34
|
+
index = Picky::Index.new :or do
|
35
|
+
symbol_keys true
|
36
|
+
category :text
|
37
|
+
end
|
38
|
+
thing = OpenStruct.new id: 1, text: "hello ohai"
|
39
|
+
other = OpenStruct.new id: 2, text: "hello kthxbye"
|
40
|
+
|
41
|
+
index.add thing
|
42
|
+
index.add other
|
43
|
+
|
44
|
+
index
|
45
|
+
end
|
46
|
+
let(:try) { Picky::Search.new(index) { symbol_keys } }
|
47
|
+
it { try.search("hello text:ohai|text:kthxbye").ids.should == [1, 2] }
|
48
|
+
it { try.search("hello text:ohai|kthxbye").ids.should == [1, 2] }
|
49
|
+
it { try.search("hello ohai|text:kthxbye").ids.should == [1, 2] }
|
50
|
+
it { try.search("hello ohai|kthxbye").ids.should == [1, 2] }
|
51
|
+
it('still works') { try.search("hello text:ohai").ids.should == [1] }
|
52
|
+
end
|
53
|
+
|
32
54
|
context 'more complex cases' do
|
33
55
|
let(:index) do
|
34
56
|
index = Picky::Index.new :or do
|