pg_search 0.6.3 → 0.6.4
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.
- data/CHANGELOG.rdoc +4 -0
- data/lib/pg_search/scope_options.rb +2 -2
- data/lib/pg_search/version.rb +1 -1
- data/spec/integration/pg_search_spec.rb +16 -0
- metadata +155 -136
- checksums.yaml +0 -7
data/CHANGELOG.rdoc
CHANGED
@@ -36,8 +36,8 @@ module PgSearch
|
|
36
36
|
config.features.map do |feature_name, feature_options|
|
37
37
|
feature_for(feature_name).conditions
|
38
38
|
end.inject do |accumulator, expression|
|
39
|
-
Arel::Nodes::Or.new(accumulator, expression)
|
40
|
-
end
|
39
|
+
Arel::Nodes::Or.new(accumulator, expression)
|
40
|
+
end.to_sql
|
41
41
|
end
|
42
42
|
|
43
43
|
def order_within_rank
|
data/lib/pg_search/version.rb
CHANGED
@@ -564,6 +564,13 @@ describe "an Active Record model which includes PgSearch" do
|
|
564
564
|
:trigram
|
565
565
|
]
|
566
566
|
|
567
|
+
ModelWithPgSearch.pg_search_scope :complex_search,
|
568
|
+
:against => [:content, :title],
|
569
|
+
:using => {
|
570
|
+
:tsearch => {:dictionary => 'english'},
|
571
|
+
:dmetaphone => {},
|
572
|
+
:trigram => {}
|
573
|
+
}
|
567
574
|
end
|
568
575
|
|
569
576
|
it "returns rows that match using any of the features" do
|
@@ -574,12 +581,21 @@ describe "an Active Record model which includes PgSearch" do
|
|
574
581
|
ModelWithPgSearch.with_trigram(trigram_query).should include(record)
|
575
582
|
ModelWithPgSearch.with_tsearch(trigram_query).should_not include(record)
|
576
583
|
ModelWithPgSearch.with_tsearch_and_trigram(trigram_query).should == [record]
|
584
|
+
ModelWithPgSearch.complex_search(trigram_query).should include(record)
|
577
585
|
|
578
586
|
# matches tsearch only
|
579
587
|
tsearch_query = "tiles"
|
580
588
|
ModelWithPgSearch.with_tsearch(tsearch_query).should include(record)
|
581
589
|
ModelWithPgSearch.with_trigram(tsearch_query).should_not include(record)
|
582
590
|
ModelWithPgSearch.with_tsearch_and_trigram(tsearch_query).should == [record]
|
591
|
+
ModelWithPgSearch.complex_search(tsearch_query).should include(record)
|
592
|
+
|
593
|
+
# matches dmetaphone only
|
594
|
+
dmetaphone_query = "tyling"
|
595
|
+
ModelWithPgSearch.with_tsearch(dmetaphone_query).should_not include(record)
|
596
|
+
ModelWithPgSearch.with_trigram(dmetaphone_query).should_not include(record)
|
597
|
+
ModelWithPgSearch.with_tsearch_and_trigram(dmetaphone_query).should_not include(record)
|
598
|
+
ModelWithPgSearch.complex_search(dmetaphone_query).should include(record)
|
583
599
|
end
|
584
600
|
|
585
601
|
context "with feature-specific configuration" do
|
metadata
CHANGED
@@ -1,151 +1,162 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: pg_search
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 15
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 6
|
9
|
+
- 4
|
10
|
+
version: 0.6.4
|
5
11
|
platform: ruby
|
6
|
-
authors:
|
12
|
+
authors:
|
7
13
|
- Grant Hutchins
|
8
14
|
- Case Commons, LLC
|
9
15
|
autorequire:
|
10
16
|
bindir: bin
|
11
17
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
18
|
+
|
19
|
+
date: 2013-05-26 00:00:00 Z
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
15
22
|
name: activerecord
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
requirements:
|
18
|
-
- - '>='
|
19
|
-
- !ruby/object:Gem::Version
|
20
|
-
version: '3.1'
|
21
|
-
type: :runtime
|
22
23
|
prerelease: false
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
- !ruby/object:Gem::Version
|
34
|
-
version: '3.1'
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 5
|
30
|
+
segments:
|
31
|
+
- 3
|
32
|
+
- 1
|
33
|
+
version: "3.1"
|
35
34
|
type: :runtime
|
35
|
+
version_requirements: *id001
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: activesupport
|
36
38
|
prerelease: false
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
- !ruby/object:Gem::Version
|
48
|
-
version: '0'
|
39
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
hash: 5
|
45
|
+
segments:
|
46
|
+
- 3
|
47
|
+
- 1
|
48
|
+
version: "3.1"
|
49
49
|
type: :runtime
|
50
|
+
version_requirements: *id002
|
51
|
+
- !ruby/object:Gem::Dependency
|
52
|
+
name: arel
|
50
53
|
prerelease: false
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
54
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
55
|
+
none: false
|
56
|
+
requirements:
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
hash: 3
|
60
|
+
segments:
|
61
|
+
- 0
|
62
|
+
version: "0"
|
63
|
+
type: :runtime
|
64
|
+
version_requirements: *id003
|
65
|
+
- !ruby/object:Gem::Dependency
|
57
66
|
name: rake
|
58
|
-
requirement: !ruby/object:Gem::Requirement
|
59
|
-
requirements:
|
60
|
-
- - '>='
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
version: '0'
|
63
|
-
type: :development
|
64
67
|
prerelease: false
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
- - '>='
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
version: '0'
|
68
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
69
|
+
none: false
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
hash: 3
|
74
|
+
segments:
|
75
|
+
- 0
|
76
|
+
version: "0"
|
77
77
|
type: :development
|
78
|
+
version_requirements: *id004
|
79
|
+
- !ruby/object:Gem::Dependency
|
80
|
+
name: rdoc
|
78
81
|
prerelease: false
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
- - '>='
|
89
|
-
- !ruby/object:Gem::Version
|
90
|
-
version: '0'
|
82
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
83
|
+
none: false
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
hash: 3
|
88
|
+
segments:
|
89
|
+
- 0
|
90
|
+
version: "0"
|
91
91
|
type: :development
|
92
|
+
version_requirements: *id005
|
93
|
+
- !ruby/object:Gem::Dependency
|
94
|
+
name: pry
|
92
95
|
prerelease: false
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
- - '>='
|
103
|
-
- !ruby/object:Gem::Version
|
104
|
-
version: '0'
|
96
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ">="
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
hash: 3
|
102
|
+
segments:
|
103
|
+
- 0
|
104
|
+
version: "0"
|
105
105
|
type: :development
|
106
|
+
version_requirements: *id006
|
107
|
+
- !ruby/object:Gem::Dependency
|
108
|
+
name: rspec
|
106
109
|
prerelease: false
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
- - '>='
|
117
|
-
- !ruby/object:Gem::Version
|
118
|
-
version: '0'
|
110
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
111
|
+
none: false
|
112
|
+
requirements:
|
113
|
+
- - ">="
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
hash: 3
|
116
|
+
segments:
|
117
|
+
- 0
|
118
|
+
version: "0"
|
119
119
|
type: :development
|
120
|
+
version_requirements: *id007
|
121
|
+
- !ruby/object:Gem::Dependency
|
122
|
+
name: with_model
|
120
123
|
prerelease: false
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
- - '>='
|
131
|
-
- !ruby/object:Gem::Version
|
132
|
-
version: '0'
|
124
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
125
|
+
none: false
|
126
|
+
requirements:
|
127
|
+
- - ">="
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
hash: 3
|
130
|
+
segments:
|
131
|
+
- 0
|
132
|
+
version: "0"
|
133
133
|
type: :development
|
134
|
+
version_requirements: *id008
|
135
|
+
- !ruby/object:Gem::Dependency
|
136
|
+
name: will_paginate
|
134
137
|
prerelease: false
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
138
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
139
|
+
none: false
|
140
|
+
requirements:
|
141
|
+
- - ">="
|
142
|
+
- !ruby/object:Gem::Version
|
143
|
+
hash: 3
|
144
|
+
segments:
|
145
|
+
- 0
|
146
|
+
version: "0"
|
147
|
+
type: :development
|
148
|
+
version_requirements: *id009
|
149
|
+
description: PgSearch builds Active Record named scopes that take advantage of PostgreSQL's full text search
|
150
|
+
email:
|
143
151
|
- gems@nertzy.com
|
144
152
|
- casecommons-dev@googlegroups.com
|
145
153
|
executables: []
|
154
|
+
|
146
155
|
extensions: []
|
156
|
+
|
147
157
|
extra_rdoc_files: []
|
148
|
-
|
158
|
+
|
159
|
+
files:
|
149
160
|
- .autotest
|
150
161
|
- .gitignore
|
151
162
|
- .rspec
|
@@ -203,31 +214,39 @@ files:
|
|
203
214
|
- sql/uninstall_unnest.sql
|
204
215
|
- sql/unnest.sql
|
205
216
|
homepage: https://github.com/Casecommons/pg_search
|
206
|
-
licenses:
|
217
|
+
licenses:
|
207
218
|
- MIT
|
208
|
-
metadata: {}
|
209
219
|
post_install_message:
|
210
220
|
rdoc_options: []
|
211
|
-
|
221
|
+
|
222
|
+
require_paths:
|
212
223
|
- lib
|
213
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
224
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
225
|
+
none: false
|
226
|
+
requirements:
|
227
|
+
- - ">="
|
228
|
+
- !ruby/object:Gem::Version
|
229
|
+
hash: 3
|
230
|
+
segments:
|
231
|
+
- 0
|
232
|
+
version: "0"
|
233
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
234
|
+
none: false
|
235
|
+
requirements:
|
236
|
+
- - ">="
|
237
|
+
- !ruby/object:Gem::Version
|
238
|
+
hash: 3
|
239
|
+
segments:
|
240
|
+
- 0
|
241
|
+
version: "0"
|
223
242
|
requirements: []
|
243
|
+
|
224
244
|
rubyforge_project:
|
225
|
-
rubygems_version:
|
245
|
+
rubygems_version: 1.8.24
|
226
246
|
signing_key:
|
227
|
-
specification_version:
|
228
|
-
summary: PgSearch builds Active Record named scopes that take advantage of PostgreSQL's
|
229
|
-
|
230
|
-
test_files:
|
247
|
+
specification_version: 3
|
248
|
+
summary: PgSearch builds Active Record named scopes that take advantage of PostgreSQL's full text search
|
249
|
+
test_files:
|
231
250
|
- spec/integration/associations_spec.rb
|
232
251
|
- spec/integration/pagination_spec.rb
|
233
252
|
- spec/integration/pg_search_spec.rb
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: 002be327b000c695d0971186e1b3a2a1924f5b9f
|
4
|
-
data.tar.gz: b414d034c40908cd3d8e18a64916ae72724e3d9e
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: af2d2c1a826dd76a0157d701832a891f0e799b20bfa4dd3200444cbc3e7c280b6e342dae220997585b44f28f83bf041cf52c6aa8ef33afa9f168baf4a455bef0
|
7
|
-
data.tar.gz: 8021aadff3504589004416926ca131fb1c90b4e0c6d81bcd1b8c2d67d76ec7c4ffcb64b595e7161a0dce4338baaff8195266268cc474d946514527d2e85a066e
|