solrizer 3.1.0 → 3.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1bfcd13e75eee3622c67f1cfac1222e73eb545b5
4
- data.tar.gz: 844f374fc4c03f895c99a415439449344b722291
3
+ metadata.gz: 2352b7c26cf55046a975d909108924a8ca9021f8
4
+ data.tar.gz: c83e79545b2caa984d75f2deb6bd14d3495a057e
5
5
  SHA512:
6
- metadata.gz: 909cc4d4eb25b94b595c1eebbbb87921e892bc15f0fe6cb5c2b2b9ffe8865f99f85a478b5cfeb210011076ae5f31a8c75442cd2f35e5f41bd39dfb87a174ad18
7
- data.tar.gz: f74ed09971903812dc3ae0e1ba8aaf258596226f3f258e3a4d739a6005fdcad90b3bc906bfa1202537c4808cabfcc0995f130921e8b9e7d0253ac906f10092a4
6
+ metadata.gz: 518b8942031a7de396ebfd51b0e3de9b933ec0f9a06e10d5f53249655dee2ebfc9da6ad65a42036dec7fbf9f6bd0614f84f2ae4ce411e036c63ddeffd5b41967
7
+ data.tar.gz: d3e557a70e7f9fd80c6be842b5fb392eee8e93f786638ae691b6ee7c4c9b5bbb7ea939b61f42d2854e19c2a075e247e49d9240085ca6d08484cac57f6d6a20b4
data/.travis.yml ADDED
@@ -0,0 +1,10 @@
1
+ rvm:
2
+ - 1.9.3
3
+ - 2.0.0
4
+
5
+ gemfile:
6
+ - gemfiles/gemfile.rails3
7
+ - gemfiles/gemfile.rails4
8
+
9
+ notifications:
10
+ irc: "irc.freenode.org#projecthydra"
data/README.textile CHANGED
@@ -38,7 +38,7 @@ require "solrizer"
38
38
 
39
39
  h3. Field Mapper
40
40
 
41
- The FieldMapper maps term names and values to Solr fields, based on the term’s data type and any index_as options. Solrizer comes with default mappings (which are defined in the config/solr_mappings.yml) to dynamic field types defined in the Hydra Solr schema.xml file. A copy of that is available :
41
+ The FieldMapper maps term names and values to Solr fields, based on the term’s data type and any index_as options. Solrizer comes with default mappings to dynamic field types defined in the Hydra Solr schema.xml file. A copy of that is available :
42
42
  https://github.com/projecthydra/hydra-head/blob/master/hydra-core/lib/generators/hydra/templates/solr_conf/conf/schema.xml
43
43
 
44
44
  More information on the conventions followed for the dynamic solr fields is here:
@@ -0,0 +1,11 @@
1
+ source "http://rubygems.org"
2
+
3
+ gemspec :path=>"../"
4
+
5
+ gem 'activesupport', '~> 3.2.13'
6
+
7
+ group :development, :test do
8
+ gem 'rcov', :platform => :mri_18
9
+ gem 'simplecov', :platform => :mri_19
10
+ gem 'simplecov-rcov', :platform => :mri_19
11
+ end
@@ -0,0 +1,10 @@
1
+ source "http://rubygems.org"
2
+
3
+ gemspec :path=>"../"
4
+
5
+ gem 'activesupport', '4.0.0.rc1'
6
+
7
+ group :development, :test do
8
+ gem 'simplecov', :platform => :mri_19
9
+ gem 'simplecov-rcov', :platform => :mri_19
10
+ end
@@ -78,8 +78,11 @@ module Solrizer
78
78
  def self.stored_searchable_field_definition
79
79
  lambda do |type|
80
80
  type = :text_en if [:string, :text].include?(type) # for backwards compatibility with old solr schema
81
- vals = [type, :indexed, :stored, :multivalued]
82
- vals
81
+ if type == :boolean
82
+ [type, :indexed, :stored]
83
+ else
84
+ [type, :indexed, :stored, :multivalued]
85
+ end
83
86
  end
84
87
  end
85
88
 
@@ -170,6 +170,8 @@ module Solrizer
170
170
  :integer
171
171
  when DateTime
172
172
  :time
173
+ when TrueClass, FalseClass
174
+ :boolean
173
175
  else
174
176
  value.class.to_s.underscore.to_sym
175
177
  end
@@ -205,7 +207,7 @@ module Solrizer
205
207
  data_type = extract_type(single_value)
206
208
  name, converter = descriptor.name_and_converter(field_name, type: data_type)
207
209
  next unless name
208
-
210
+
209
211
  # Is there a custom converter?
210
212
  # TODO instead of a custom converter, look for input data type and output data type. Create a few methods that can do that cast.
211
213
 
@@ -215,6 +217,8 @@ module Solrizer
215
217
  else
216
218
  converter.call(single_value, field_name)
217
219
  end
220
+ elsif data_type == :boolean
221
+ single_value
218
222
  else
219
223
  single_value.to_s
220
224
  end
@@ -49,6 +49,8 @@ module Solrizer
49
49
  'dt'
50
50
  when :integer
51
51
  'i'
52
+ when :boolean
53
+ 'b'
52
54
  end
53
55
  end,
54
56
  stored_suffix: 's',
@@ -1,3 +1,3 @@
1
1
  module Solrizer
2
- VERSION = "3.1.0"
2
+ VERSION = "3.1.1"
3
3
  end
@@ -25,6 +25,10 @@ describe Solrizer do
25
25
  Solrizer.insert_field(doc, 'foo', Time.parse('2013-01-13T22:45:56+06:00'))
26
26
  doc.should == {'foo_dtsim' => ["2013-01-13T16:45:56Z"]}
27
27
  end
28
+ it "should insert Booleans" do
29
+ Solrizer.insert_field(doc, 'foo', true)
30
+ doc.should == {'foo_bsi' => true}
31
+ end
28
32
 
29
33
  it "should insert multiple values" do
30
34
  Solrizer.insert_field(doc, 'foo', ['A name', 'B name'], :sortable, :facetable)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solrizer
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Zumwalt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-03 00:00:00.000000000 Z
11
+ date: 2013-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -162,6 +162,7 @@ extra_rdoc_files:
162
162
  - README.textile
163
163
  files:
164
164
  - .gitignore
165
+ - .travis.yml
165
166
  - Gemfile
166
167
  - History.txt
167
168
  - LICENSE
@@ -169,6 +170,8 @@ files:
169
170
  - Rakefile
170
171
  - bin/solrizer
171
172
  - bin/solrizerd
173
+ - gemfiles/gemfile.rails3
174
+ - gemfiles/gemfile.rails4
172
175
  - lib/solrizer.rb
173
176
  - lib/solrizer/common.rb
174
177
  - lib/solrizer/default_descriptors.rb