lib/solrizer/fedora/solrizer.rb in solrizer-fedora-1.0.2 vs lib/solrizer/fedora/solrizer.rb in solrizer-fedora-1.0.3

- old
+ new

@@ -29,13 +29,16 @@ @index_full_text = false end @indexer = Indexer.new( :index_full_text=>@index_full_text ) end + # Solrize the given Fedora object's full-text and facets into the search index # - # This method solrizes the given Fedora object's full-text and facets into the search index - # + # @param [String or ActiveFedora::Base] obj the object to solrize + # @param [Hash] opts optional parameters + # @example Suppress errors using :suppress_errors option + # solrizer.solrize("my:pid", :suppress_errors=>true) def solrize( obj, opts={} ) # retrieve the Fedora object based on the given unique id begin @@ -78,24 +81,26 @@ end end #begin end + # Retrieve a comprehensive list of all the unique identifiers in Fedora and + # solrize each object's full-text and facets into the search index # - # This method retrieves a comprehensive list of all the unique identifiers in Fedora and - # solrizes each object's full-text and facets into the search index - def solrize_objects + # @example Suppress errors using :suppress_errors option + # solrizer.solrize_objects( :suppress_errors=>true ) + def solrize_objects(opts={}) # retrieve a list of all the pids in the fedora repository num_docs = 1000000 # modify this number to guarantee that all the objects are retrieved from the repository puts "WARNING: You have turned off indexing of Full Text content. Be sure to re-run indexer with @@index_full_text set to true in main.rb" if index_full_text == false if @@index_list == false objects = ::Fedora::Repository.instance.find_objects(:limit=>num_docs) puts "Shelving #{objects.length} Fedora objects" objects.each do |object| - solrize( object ) + solrize( object, opts ) end else if File.exists?(@@index_list) \ No newline at end of file