app/models/concerns/solr_doc.rb
# Prepare Solr document hash for the record
Prepare Solr document hash for the record
Prepare Solr document hash for the record
def solr_doc_data
      @doc = {
        id: solr_id,
        record_type: self.class.to_s.underscore,
        record_id: id,
        data: json_data,
        created_at: created_at,
        updated_at: updated_at
      }
      case self
      when Order
        add_order_data_to_solr_doc
      when Item
        add_item_data_to_solr_doc
      when User
        add_user_data_to_solr_doc
      when Location
        add_location_data_to_solr_doc
      end
      @doc.delete_if { |k,v| nil_or_empty?(v) }
      @doc
    end
def solr_doc_data @doc = { id : solr_id , record_type : self . class . to_s . underscore , record_id : id , data : json_data , created_at : created_at , updated_at : updated_at } case self when Order add_order_data_to_solr_doc when Item add_item_data_to_solr_doc when User add_user_data_to_solr_doc when Location add_location_data_to_solr_doc end @doc . delete_if { | k , v | nil_or_empty? ( v ) } @doc end
Prepare Solr document hash for the record
Prepare Solr document hash for the record
# remove nil/empty values