Module: Solrizer::DefaultDescriptors

Defined in:
lib/solrizer/default_descriptors.rb

Class Method Summary collapse

Class Method Details

.dateableObject

Takes fields which are stored as strings, but we want indexed as dates. (e.g. “November 6th, 2012”) produces suffixes:

_dtsim - for dates


23
24
25
# File 'lib/solrizer/default_descriptors.rb', line 23

def self.dateable
  @dateable ||= Descriptor.new(:date, :stored, :indexed, :multivalued, converter: dateable_converter)
end

.displayableObject

Produces _ssm suffix



55
56
57
# File 'lib/solrizer/default_descriptors.rb', line 55

def self.displayable
  @displayable ||= Descriptor.new(:string, :stored, :multivalued)
end

.facetableObject

Produces _sim suffix



28
29
30
# File 'lib/solrizer/default_descriptors.rb', line 28

def self.facetable
  @facetable ||= Descriptor.new(:string, :indexed, :multivalued)
end

.searchableObject

The suffix produced depends on the type parameter – produces suffixes:

_teim - for strings or text fields
_dtim - for dates
_iim - for integers


16
17
18
# File 'lib/solrizer/default_descriptors.rb', line 16

def self.searchable
  @searchable ||= Descriptor.new(searchable_field_definition, converter: searchable_converter, requires_type: true)
end

.simpleObject



64
65
66
# File 'lib/solrizer/default_descriptors.rb', line 64

def self.simple
  @simple ||= Descriptor.new(lambda {|field_type| [field_type, :indexed]})
end

.sortableObject

The suffix produced depends on the type parameter – produces suffixes:

_tei - for text fields
_si - for strings 
_dti - for dates
_ii - for integers


43
44
45
# File 'lib/solrizer/default_descriptors.rb', line 43

def self.sortable
  @sortable ||= Descriptor.new(sortable_field_definition, converter: searchable_converter, requires_type: true)
end

.stored_searchableObject

The suffix produced depends on the type parameter – produces suffixes:

_tesim - for strings or text fields
_dtsim - for dates
_isim - for integers


8
9
10
# File 'lib/solrizer/default_descriptors.rb', line 8

def self.stored_searchable
  @stored_searchable ||= Descriptor.new(stored_searchable_field_definition, converter: searchable_converter, requires_type: true)
end

.stored_sortableObject

Fields that are both stored and sortable Produces _ssi suffix if field_type is string Produces _dtsi suffix if field_type is date



50
51
52
# File 'lib/solrizer/default_descriptors.rb', line 50

def self.stored_sortable
  @stored_sortable ||= Descriptor.new(lambda {|field_type| [field_type, :stored, :indexed]}, converter: searchable_converter)
end

.symbolObject

Produces _ssim suffix This is useful for when you only want to match whole words, such as user/group names from the the rightsMetadata datastream



34
35
36
# File 'lib/solrizer/default_descriptors.rb', line 34

def self.symbol
  @symbol ||= Descriptor.new(:string, :stored, :indexed, :multivalued)
end

.unstemmed_searchableObject

Produces _tim suffix (used to be _unstem)



60
61
62
# File 'lib/solrizer/default_descriptors.rb', line 60

def self.unstemmed_searchable
  @unstemmed_searchable ||= Descriptor.new(:text, :indexed, :multivalued)
end