Class: Solr::Query::Request::FieldList

Inherits:
Object
  • Object
show all
Includes:
Support::SchemaHelper
Defined in:
lib/solr/query/request/field_list.rb

Constant Summary collapse

MANDATORY_FIELDS =
%i[id].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Support::SchemaHelper

#solarize_field

Constructor Details

#initialize(fields: []) ⇒ FieldList

Returns a new instance of FieldList.



11
12
13
# File 'lib/solr/query/request/field_list.rb', line 11

def initialize(fields: [])
  @fields = fields
end

Instance Attribute Details

#fieldsObject

Returns the value of attribute fields.



9
10
11
# File 'lib/solr/query/request/field_list.rb', line 9

def fields
  @fields
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/solr/query/request/field_list.rb', line 15

def empty?
  fields.empty?
end

#to_solr_sObject



19
20
21
# File 'lib/solr/query/request/field_list.rb', line 19

def to_solr_s
  (MANDATORY_FIELDS + fields.map(&method(:solarize_field))).uniq.join(',')
end