multi-solr 01.07.05 → 01.07.06
Sign up to get free protection for your applications and to get access to all the features.
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/lib/multi_solr/single_core_handler.rb +4 -2
- data/lib/multi_solr/version.rb +1 -1
- data/spec/multi_solr/single_core_handler_spec.rb +7 -0
- metadata +6 -4
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
multi-solr
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby-1.8.7-p334
|
@@ -84,14 +84,16 @@ class MultiSolr::SingleCoreHandler
|
|
84
84
|
if value_pairs && !value_pairs.empty?
|
85
85
|
# das value_pairs besteht Paar-weise aus Value und Anzahl
|
86
86
|
# Es werden hier nur die Values gebraucht, wo die Anzahl >0 ist
|
87
|
+
only_int = true
|
87
88
|
value_pairs.each do |value_count_pair|
|
88
89
|
val, count = value_count_pair
|
89
90
|
if val && count > 0
|
90
|
-
|
91
|
-
val = val.to_i if !val.match(/[^0-9]/)
|
91
|
+
only_int = false if only_int && !val.match(/^[0-9]+$/)
|
92
92
|
values << val
|
93
93
|
end
|
94
94
|
end
|
95
|
+
# wenn val nur aus Zahlen besteht, dann nach Integer konvertieren (wegen der Sortierung)
|
96
|
+
values.map!(&:to_i) if only_int
|
95
97
|
values.sort!
|
96
98
|
end
|
97
99
|
end
|
data/lib/multi_solr/version.rb
CHANGED
@@ -38,6 +38,13 @@ describe MultiSolr::SingleCoreHandler do
|
|
38
38
|
subject.stub(:search).and_return(result)
|
39
39
|
subject.list_possible_values(:p2).should == [11, 2233] # Int-Strings sollten nach int konvertiert sein
|
40
40
|
end
|
41
|
+
|
42
|
+
it "should for field p3 an Array of mixed values sortet " do
|
43
|
+
result = double :solr_result
|
44
|
+
result.stub(:facet_counts).and_return('p2' => [['2233', 2], ['blue', 3]])
|
45
|
+
subject.stub(:search).and_return(result)
|
46
|
+
subject.list_possible_values(:p2).should == ['2233', 'blue'] # Int-Strings sollten NICHT nach int konvertiert sein
|
47
|
+
end
|
41
48
|
end
|
42
49
|
|
43
50
|
context "solr_connection" do
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: multi-solr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 7
|
9
|
-
-
|
10
|
-
version: 01.07.
|
9
|
+
- 6
|
10
|
+
version: 01.07.06
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Bernd Ledig
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2013-
|
18
|
+
date: 2013-07-02 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
prerelease: false
|
@@ -123,6 +123,8 @@ extra_rdoc_files: []
|
|
123
123
|
files:
|
124
124
|
- .gitignore
|
125
125
|
- .rspec
|
126
|
+
- .ruby-gemset
|
127
|
+
- .ruby-version
|
126
128
|
- Gemfile
|
127
129
|
- Rakefile
|
128
130
|
- lib/multi_solr.rb
|