multi-solr 01.09.05 → 01.10.00
Sign up to get free protection for your applications and to get access to all the features.
- data/.ruby-version +1 -1
- data/lib/multi_solr/solr_filter_collection.rb +1 -2
- data/lib/multi_solr/solr_filter_simple.rb +9 -1
- data/lib/multi_solr/version.rb +1 -1
- data/spec/multi_solr/solr_filter_simple_spec.rb +54 -0
- metadata +101 -110
- data/.ruby-gemset +0 -1
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-1.
|
1
|
+
ruby-1.9.3-p194
|
@@ -70,9 +70,8 @@ class MultiSolr::SolrFilterCollection < MultiSolr::SolrFilterSimple
|
|
70
70
|
end
|
71
71
|
|
72
72
|
|
73
|
-
#
|
73
|
+
# Wandelt angegebenen value in ein Array (wenn es noch keins ist)
|
74
74
|
# Bereinigt das Array von leeren Elementen
|
75
|
-
|
76
75
|
def compact_values value
|
77
76
|
value = [value] unless value.is_a?(Array)
|
78
77
|
value.delete_if(&:blank?)
|
@@ -5,6 +5,7 @@ class MultiSolr::SolrFilterSimple
|
|
5
5
|
|
6
6
|
attr_reader :name # Name des Filters als Symbol
|
7
7
|
attr_reader :options # Options des Filters
|
8
|
+
attr_reader :field_name
|
8
9
|
|
9
10
|
# Constructor des Filters
|
10
11
|
# Params:
|
@@ -63,7 +64,14 @@ class MultiSolr::SolrFilterSimple
|
|
63
64
|
|
64
65
|
|
65
66
|
def label
|
66
|
-
I18n.t("solr_search.#{@name}", :default => [@name, @name.to_s])
|
67
|
+
name = I18n.t("solr_search.#{@name}", :default => [@name, @name.to_s])
|
68
|
+
prefix = @options[:label_prefix]
|
69
|
+
if prefix
|
70
|
+
prefix_l = I18n.t("solr_search.#{prefix}", :default => [prefix, prefix.to_s])
|
71
|
+
"#{prefix_l}-#{name}"
|
72
|
+
else
|
73
|
+
name
|
74
|
+
end
|
67
75
|
end
|
68
76
|
|
69
77
|
def sanitize_value value
|
data/lib/multi_solr/version.rb
CHANGED
@@ -0,0 +1,54 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'multi_solr/utils'
|
3
|
+
|
4
|
+
describe MultiSolr::SolrFilterRange do
|
5
|
+
|
6
|
+
subject{ MultiSolr::SolrFilterSimple.new('test') }
|
7
|
+
|
8
|
+
context 'render_value' do
|
9
|
+
it "should return '' if value is nil" do
|
10
|
+
subject.render_value(nil).should == ''
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should return value as String" do
|
14
|
+
subject.render_value(20).should == '20'
|
15
|
+
end
|
16
|
+
|
17
|
+
it "should use special renderer if configured" do
|
18
|
+
value_script = ->(val, opt) { (val.to_i + 10).to_s }
|
19
|
+
subject = MultiSolr::SolrFilterSimple.new('test', :render_value => value_script)
|
20
|
+
subject.render_value('30').should == '40'
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
context 'build_solr_query' do
|
26
|
+
it do
|
27
|
+
subject.build_solr_query(nil).should be_nil
|
28
|
+
end
|
29
|
+
|
30
|
+
it do
|
31
|
+
subject.build_solr_query(10).should == 'test:10'
|
32
|
+
end
|
33
|
+
|
34
|
+
it do
|
35
|
+
build_script = ->(val) { "-test:#{val}" }
|
36
|
+
subject = MultiSolr::SolrFilterSimple.new('test', :solr_query => build_script)
|
37
|
+
subject.build_solr_query(50).should == '-test:50'
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
|
42
|
+
|
43
|
+
context 'label' do
|
44
|
+
it do
|
45
|
+
subject.label.should == 'test'
|
46
|
+
end
|
47
|
+
|
48
|
+
it do
|
49
|
+
subject = MultiSolr::SolrFilterSimple.new('test', :label_prefix => 'L2')
|
50
|
+
subject.label.should == 'L2-test'
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
metadata
CHANGED
@@ -1,129 +1,123 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: multi-solr
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 01.10.00
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 9
|
9
|
-
- 5
|
10
|
-
version: 01.09.05
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Bernd Ledig
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
21
|
-
prerelease: false
|
12
|
+
date: 2014-04-28 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
22
15
|
name: rsolr
|
23
|
-
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
26
|
-
- -
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
|
29
|
-
segments:
|
30
|
-
- 1
|
31
|
-
- 0
|
32
|
-
version: "1.0"
|
18
|
+
requirements:
|
19
|
+
- - ! '>'
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '1.0'
|
33
22
|
- - <
|
34
|
-
- !ruby/object:Gem::Version
|
35
|
-
|
36
|
-
segments:
|
37
|
-
- 2
|
38
|
-
- 0
|
39
|
-
version: "2.0"
|
40
|
-
requirement: *id001
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: '2.0'
|
41
25
|
type: :runtime
|
42
|
-
- !ruby/object:Gem::Dependency
|
43
26
|
prerelease: false
|
27
|
+
version_requirements: !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>'
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '1.0'
|
33
|
+
- - <
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: '2.0'
|
36
|
+
- !ruby/object:Gem::Dependency
|
44
37
|
name: activesupport
|
45
|
-
|
38
|
+
requirement: !ruby/object:Gem::Requirement
|
46
39
|
none: false
|
47
|
-
requirements:
|
48
|
-
- -
|
49
|
-
- !ruby/object:Gem::Version
|
50
|
-
|
51
|
-
segments:
|
52
|
-
- 3
|
53
|
-
- 0
|
54
|
-
version: "3.0"
|
40
|
+
requirements:
|
41
|
+
- - ! '>'
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '3.0'
|
55
44
|
- - <
|
56
|
-
- !ruby/object:Gem::Version
|
57
|
-
|
58
|
-
segments:
|
59
|
-
- 4
|
60
|
-
- 0
|
61
|
-
version: "4.0"
|
62
|
-
requirement: *id002
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '4.0'
|
63
47
|
type: :runtime
|
64
|
-
- !ruby/object:Gem::Dependency
|
65
48
|
prerelease: false
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>'
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
- - <
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '4.0'
|
58
|
+
- !ruby/object:Gem::Dependency
|
66
59
|
name: i18n
|
67
|
-
|
60
|
+
requirement: !ruby/object:Gem::Requirement
|
68
61
|
none: false
|
69
|
-
requirements:
|
70
|
-
- -
|
71
|
-
- !ruby/object:Gem::Version
|
72
|
-
|
73
|
-
segments:
|
74
|
-
- 0
|
75
|
-
version: "0"
|
76
|
-
requirement: *id003
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
77
66
|
type: :runtime
|
78
|
-
- !ruby/object:Gem::Dependency
|
79
67
|
prerelease: false
|
68
|
+
version_requirements: !ruby/object:Gem::Requirement
|
69
|
+
none: false
|
70
|
+
requirements:
|
71
|
+
- - ! '>='
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '0'
|
74
|
+
- !ruby/object:Gem::Dependency
|
80
75
|
name: rake
|
81
|
-
|
76
|
+
requirement: !ruby/object:Gem::Requirement
|
82
77
|
none: false
|
83
|
-
requirements:
|
84
|
-
- -
|
85
|
-
- !ruby/object:Gem::Version
|
86
|
-
|
87
|
-
segments:
|
88
|
-
- 0
|
89
|
-
version: "0"
|
90
|
-
requirement: *id004
|
78
|
+
requirements:
|
79
|
+
- - ! '>='
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0'
|
91
82
|
type: :development
|
92
|
-
- !ruby/object:Gem::Dependency
|
93
83
|
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
none: false
|
86
|
+
requirements:
|
87
|
+
- - ! '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
- !ruby/object:Gem::Dependency
|
94
91
|
name: rspec
|
95
|
-
|
92
|
+
requirement: !ruby/object:Gem::Requirement
|
96
93
|
none: false
|
97
|
-
requirements:
|
98
|
-
- -
|
99
|
-
- !ruby/object:Gem::Version
|
100
|
-
|
101
|
-
segments:
|
102
|
-
- 2
|
103
|
-
- 7
|
104
|
-
version: "2.7"
|
94
|
+
requirements:
|
95
|
+
- - ! '>'
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '2.7'
|
105
98
|
- - <
|
106
|
-
- !ruby/object:Gem::Version
|
107
|
-
|
108
|
-
segments:
|
109
|
-
- 3
|
110
|
-
- 0
|
111
|
-
version: "3.0"
|
112
|
-
requirement: *id005
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: '3.0'
|
113
101
|
type: :development
|
102
|
+
prerelease: false
|
103
|
+
version_requirements: !ruby/object:Gem::Requirement
|
104
|
+
none: false
|
105
|
+
requirements:
|
106
|
+
- - ! '>'
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
version: '2.7'
|
109
|
+
- - <
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '3.0'
|
114
112
|
description: SOLR-Framework wit multi-core supoort and filters
|
115
|
-
email:
|
113
|
+
email:
|
116
114
|
- bernd.ledig@ottogroup.com
|
117
115
|
executables: []
|
118
|
-
|
119
116
|
extensions: []
|
120
|
-
|
121
117
|
extra_rdoc_files: []
|
122
|
-
|
123
|
-
files:
|
118
|
+
files:
|
124
119
|
- .gitignore
|
125
120
|
- .rspec
|
126
|
-
- .ruby-gemset
|
127
121
|
- .ruby-version
|
128
122
|
- Gemfile
|
129
123
|
- README.md
|
@@ -152,6 +146,7 @@ files:
|
|
152
146
|
- spec/multi_solr/solr_filter_boolean_spec.rb
|
153
147
|
- spec/multi_solr/solr_filter_collection_spec.rb
|
154
148
|
- spec/multi_solr/solr_filter_range_spec.rb
|
149
|
+
- spec/multi_solr/solr_filter_simple_spec.rb
|
155
150
|
- spec/multi_solr/timeline_core_handler_spec.rb
|
156
151
|
- spec/multi_solr/utils_spec.rb
|
157
152
|
- spec/solr_test_helper.rb
|
@@ -181,38 +176,34 @@ files:
|
|
181
176
|
- test-solr/start-test-solr.sh
|
182
177
|
- test-solr/start.jar
|
183
178
|
- test-solr/webapps/solr.war
|
184
|
-
homepage:
|
179
|
+
homepage: ''
|
185
180
|
licenses: []
|
186
|
-
|
187
181
|
post_install_message:
|
188
182
|
rdoc_options: []
|
189
|
-
|
190
|
-
require_paths:
|
183
|
+
require_paths:
|
191
184
|
- lib
|
192
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
185
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
193
186
|
none: false
|
194
|
-
requirements:
|
195
|
-
- -
|
196
|
-
- !ruby/object:Gem::Version
|
197
|
-
|
198
|
-
segments:
|
187
|
+
requirements:
|
188
|
+
- - ! '>='
|
189
|
+
- !ruby/object:Gem::Version
|
190
|
+
version: '0'
|
191
|
+
segments:
|
199
192
|
- 0
|
200
|
-
|
201
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
193
|
+
hash: 727765555297971495
|
194
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
202
195
|
none: false
|
203
|
-
requirements:
|
204
|
-
- -
|
205
|
-
- !ruby/object:Gem::Version
|
206
|
-
|
207
|
-
segments:
|
196
|
+
requirements:
|
197
|
+
- - ! '>='
|
198
|
+
- !ruby/object:Gem::Version
|
199
|
+
version: '0'
|
200
|
+
segments:
|
208
201
|
- 0
|
209
|
-
|
202
|
+
hash: 727765555297971495
|
210
203
|
requirements: []
|
211
|
-
|
212
204
|
rubyforge_project: multi-solr
|
213
205
|
rubygems_version: 1.8.24
|
214
206
|
signing_key:
|
215
207
|
specification_version: 3
|
216
208
|
summary: SOLR-Framework with support for multiple SOLR-Cores
|
217
209
|
test_files: []
|
218
|
-
|
data/.ruby-gemset
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
multi-solr
|