solrizer 2.0.0.rc5 → 2.0.0.rc6

Sign up to get free protection for your applications and to get access to all the features.
@@ -331,7 +331,7 @@ module Solrizer
331
331
  index_as :searchable, :default => true do |t|
332
332
  t.default :suffix => '_t'
333
333
  t.date :suffix => '_dt' do |value|
334
- value.is_a?(Date) ? Time.parse(value.to_s).utc.iso8601 : Time.parse(value).utc.iso8601
334
+ value.is_a?(Date) ? DateTime.parse(value.to_s).to_time.utc.iso8601 : DateTime.parse(value).to_time.utc.iso8601
335
335
  end
336
336
  t.string :suffix => '_t'
337
337
  t.text :suffix => '_t'
@@ -1,3 +1,3 @@
1
1
  module Solrizer
2
- VERSION = "2.0.0.rc5"
2
+ VERSION = "2.0.0.rc6"
3
3
  end
@@ -38,7 +38,7 @@ module Solrizer::XML::TerminologyBasedSolrizer
38
38
  # TODO: Solrizer::FieldMapper::Default is supposed to translate dates into full ISO 8601 formatted strings.
39
39
  # However, there an integration issue with ActiveFedora using OM: it ignores the default field mapper given
40
40
  # in this gem that does this. So, the following is a workaround until it is fixed.
41
- node = n.is_a?(Date) ? Time.parse(n.to_s).utc.iso8601 : n.to_s
41
+ node = n.is_a?(Date) ? DateTime.parse(n.to_s).to_time.utc.iso8601 : n.to_s
42
42
 
43
43
  doc.solrize_node(node.to_s, term_pointer, term, solr_doc, field_mapper)
44
44
  unless term.kind_of? OM::XML::NamedTermProxy
@@ -79,7 +79,7 @@ module Samples
79
79
  t.title(:proxy=>[:title_info, :main_title])
80
80
  t.journal_title(:proxy=>[:journal, :title_info, :main_title])
81
81
  t.pub_date(:proxy=>[:journal, :issue, :publication_date])
82
- t.issue_date(:ref=>[:journal, :origin_info, :date_issued])
82
+ t.issue_date(:ref=>[:journal, :origin_info, :date_issued], :type=> :date)
83
83
  end
84
84
 
85
85
  # Changes from OM::Properties implementation
@@ -205,9 +205,9 @@ describe Solrizer::FieldMapper do
205
205
  end
206
206
 
207
207
  it "should support full ISO 8601 dates" do
208
- @mapper.solr_names_and_values('foo', "2012-11-06", :date, []).should == { 'foo_dt' =>["2012-11-06T05:00:00Z"] }
209
- @mapper.solr_names_and_values('foo', "November 6th, 2012", :date, []).should == { 'foo_dt' =>["2012-11-06T05:00:00Z"] }
210
- @mapper.solr_names_and_values('foo', Date.parse("6 Nov. 2012"), :date, []).should == { 'foo_dt' =>["2012-11-06T05:00:00Z"] }
208
+ @mapper.solr_names_and_values('foo', "2012-11-06", :date, []).should == { 'foo_dt' =>["2012-11-06T00:00:00Z"] }
209
+ @mapper.solr_names_and_values('foo', "November 6th, 2012", :date, []).should == { 'foo_dt' =>["2012-11-06T00:00:00Z"] }
210
+ @mapper.solr_names_and_values('foo', Date.parse("6 Nov. 2012"), :date, []).should == { 'foo_dt' =>["2012-11-06T00:00:00Z"] }
211
211
  end
212
212
 
213
213
  it "should support displayable, facetable, sortable, unstemmed" do
@@ -55,7 +55,7 @@ describe Solrizer::XML::TerminologyBasedSolrizer do
55
55
  solr_doc["topic_tag_t"].sort.should == ["CONTROLLED TERM", "TOPIC 1", "TOPIC 2"]
56
56
 
57
57
  # These are a holdover from an old verison of OM
58
- solr_doc['journal_0_issue_0_publication_date_dt'].should == ["2007-02-01T05:00:00Z"]
58
+ solr_doc['journal_0_issue_0_publication_date_dt'].should == ["2007-02-01T00:00:00Z"]
59
59
 
60
60
 
61
61
  end
@@ -89,14 +89,14 @@ describe Solrizer::XML::TerminologyBasedSolrizer do
89
89
  unless RUBY_VERSION.match("1.8.7")
90
90
  solr_doc = Hash.new
91
91
  result = @mods_article.solrize_term(Samples::ModsArticle.terminology.retrieve_term(:pub_date), solr_doc)
92
- solr_doc["pub_date_dt"].should == ["2007-02-01T05:00:00Z"]
92
+ solr_doc["pub_date_dt"].should == ["2007-02-01T00:00:00Z"]
93
93
  end
94
94
  end
95
95
 
96
96
  it "should add fields based on type using ref" do
97
97
  solr_doc = Hash.new
98
98
  result = @mods_article.solrize_term(Samples::ModsArticle.terminology.retrieve_term(:issue_date), solr_doc)
99
- solr_doc["issue_date_dt"].should == ["2007-02-15T05:00:00Z"]
99
+ solr_doc["issue_date_dt"].should == ["2007-02-15T00:00:00Z"]
100
100
  end
101
101
 
102
102
  it "shouldn't index terms where index_as is an empty array" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solrizer
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.rc5
4
+ version: 2.0.0.rc6
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-07 00:00:00.000000000 Z
12
+ date: 2012-11-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
@@ -264,3 +264,4 @@ test_files:
264
264
  - spec/units/field_name_mapper_spec.rb
265
265
  - spec/units/xml_extractor_spec.rb
266
266
  - spec/units/xml_terminology_based_solrizer_spec.rb
267
+ has_rdoc: