Class: Surfliner::MetadataConsumer::Solr::IndexHandler

Inherits:
MessageHandler
  • Object
show all
Defined in:
lib/surfliner/metadata_consumer/solr/index_handler.rb

Overview

Message handler that indexes resources into Solr.

Constant Summary collapse

SOLR_ATTRIBUTES =
{commitWithin: 10}.freeze

Instance Attribute Summary

Attributes inherited from MessageHandler

#payload

Instance Method Summary collapse

Methods inherited from MessageHandler

handle, handler_for, #initialize, #solr_connection

Constructor Details

This class inherits a constructor from Surfliner::MetadataConsumer::Solr::MessageHandler

Instance Method Details

#handleObject

Retrieves the resource specified in the message from Superskunk, converts it to a Solr document, and adds it to Solr.



19
20
21
# File 'lib/surfliner/metadata_consumer/solr/index_handler.rb', line 19

def handle
  index(build_document(SuperskunkClient.get(payload.resource_url)))
end