solrizer 3.0.0.pre5 → 3.0.0.pre6
Sign up to get free protection for your applications and to get access to all the features.
@@ -34,6 +34,13 @@ module Solrizer
|
|
34
34
|
@sortable ||= Descriptor.new(:string, :indexed)
|
35
35
|
end
|
36
36
|
|
37
|
+
# Fields that are both stored and sortable
|
38
|
+
# Produces _ssi suffix if field_type is string
|
39
|
+
# Produces _dtsi suffix if field_type is date
|
40
|
+
def self.stored_sortable
|
41
|
+
@stored_sortable ||= Descriptor.new(lambda {|field_type| [field_type, :stored, :indexed]}, converter: searchable_converter)
|
42
|
+
end
|
43
|
+
|
37
44
|
# Produces _ssm suffix
|
38
45
|
def self.displayable
|
39
46
|
@displayable ||= Descriptor.new(:string, :stored, :multivalued)
|
data/lib/solrizer/version.rb
CHANGED
@@ -267,5 +267,12 @@ describe Solrizer::FieldMapper do
|
|
267
267
|
"foo_tim" => ["bar"] #unstemmed_searchable
|
268
268
|
}
|
269
269
|
end
|
270
|
+
|
271
|
+
it "should support stored_sortable" do
|
272
|
+
time = Time.iso8601("2012-11-06T15:16:17Z")
|
273
|
+
@mapper.solr_names_and_values('foo', time, :stored_sortable).should == {"foo_dtsi" => ["2012-11-06T15:16:17Z"]}
|
274
|
+
@mapper.solr_names_and_values('foo', 'bar', :stored_sortable).should == {"foo_ssi" => ["bar"]}
|
275
|
+
|
276
|
+
end
|
270
277
|
end
|
271
278
|
end
|
data/spec/units/solrizer_spec.rb
CHANGED
@@ -52,7 +52,7 @@ describe Solrizer do
|
|
52
52
|
describe ".solr_name" do
|
53
53
|
it "should delegate to default_field_mapper" do
|
54
54
|
Solrizer.solr_name('foo', type: :string).should == "foo_tesim"
|
55
|
-
Solrizer.solr_name('foo', :sortable).should == "
|
55
|
+
Solrizer.solr_name('foo', :sortable).should == "foo_si"
|
56
56
|
end
|
57
57
|
end
|
58
58
|
end
|
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: 3.0.0.
|
4
|
+
version: 3.0.0.pre6
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -253,7 +253,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
253
253
|
version: '0'
|
254
254
|
segments:
|
255
255
|
- 0
|
256
|
-
hash:
|
256
|
+
hash: 4544422725210300531
|
257
257
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
258
258
|
none: false
|
259
259
|
requirements:
|