Class: AdvancedQueryString

Inherits:
Object
  • Object
show all
Defined in:
backend/app/model/advanced_query_string.rb

Instance Method Summary collapse

Constructor Details

#initialize(query, use_literal) ⇒ AdvancedQueryString

Returns a new instance of AdvancedQueryString.



4
5
6
7
# File 'backend/app/model/advanced_query_string.rb', line 4

def initialize(query, use_literal)
  @query = query.transform_keys { |k| k.to_s }
  @use_literal = use_literal
end

Instance Method Details

#to_solr_sObject



9
10
11
12
13
# File 'backend/app/model/advanced_query_string.rb', line 9

def to_solr_s
  return empty_solr_s if empty_search?

  "#{prefix}#{field}:#{value}"
end