Class: Celsius::Primo::SoapApi::Searcher::SearchBrief::SearchRequestTransformation

Inherits:
Transformation
  • Object
show all
Defined in:
lib/celsius/primo/soap_api/searcher/search_brief/search_request_transformation.rb

Defined Under Namespace

Classes: AddSortByList, EmbedInnerSearchRequest, ProcessIdsQueries, ProcessMatchQueries, ProcessQueryStringQueries, ProcessRangeQueries, SerializeTargetAsXml, SetBulkSize, SetInstitution, SetLanguages, SetLocations, SetStartIndex, SetupInnerSearchRequest, SetupTarget

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ SearchRequestTransformation

Returns a new instance of SearchRequestTransformation.



33
34
35
36
37
# File 'lib/celsius/primo/soap_api/searcher/search_brief/search_request_transformation.rb', line 33

def initialize(options = {})
  @languages = options[:languages]
  @locations = options[:locations]
  @institution = options[:institution]
end

Instance Attribute Details

#inner_search_requestObject

Returns the value of attribute inner_search_request.



31
32
33
# File 'lib/celsius/primo/soap_api/searcher/search_brief/search_request_transformation.rb', line 31

def inner_search_request
  @inner_search_request
end

#institutionObject

Returns the value of attribute institution.



30
31
32
# File 'lib/celsius/primo/soap_api/searcher/search_brief/search_request_transformation.rb', line 30

def institution
  @institution
end

#languagesObject

Returns the value of attribute languages.



28
29
30
# File 'lib/celsius/primo/soap_api/searcher/search_brief/search_request_transformation.rb', line 28

def languages
  @languages
end

#locationsObject

Returns the value of attribute locations.



29
30
31
# File 'lib/celsius/primo/soap_api/searcher/search_brief/search_request_transformation.rb', line 29

def locations
  @locations
end

Instance Method Details

#index_field_mapping(index_field) ⇒ Object



39
40
41
42
43
44
45
46
47
48
# File 'lib/celsius/primo/soap_api/searcher/search_brief/search_request_transformation.rb', line 39

def index_field_mapping(index_field)
  case index_field
  when "_all"       then "any"
  when "created"    then "cdate"
  when "identifier" then "any"
  when "language"   then "lang"
  when "subject"    then "sub"
  else index_field
  end
end

#sort_field_mapping(sort_field) ⇒ Object



50
51
52
53
54
55
56
57
58
# File 'lib/celsius/primo/soap_api/searcher/search_brief/search_request_transformation.rb', line 50

def sort_field_mapping(sort_field)
  case sort_field
  when "_score"  then "relevance"
  when "created" then "scdate"
  when "creator" then "screator"
  when "title"   then "stitle"
  else sort_field
  end
end