Skip to content

Doc: fix return example as @example only allows one line #889

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 18, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 33 additions & 12 deletions elasticsearch-model/lib/elasticsearch/model/importing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,29 @@ module ClassMethods
#
# @yield [Hash] Gives the Hash with the Elasticsearch response to the block
#
# @return [Fixnum] Number of errors encountered during importing
# @return [Fixnum] default, number of errors encountered during importing
# @return [Array<Hash>] if +return+ option is specified to be +"errors"+,
# contains only those failed items in the response +items+ key, e.g.:
#
# [
# {
# "index" => {
# "error" => 'FAILED',
# "_index" => "test",
# "_type" => "_doc",
# "_id" => '1',
# "_version" => 1,
# "result" => "foo",
# "_shards" => {
# "total" => 1,
# "successful" => 0,
# "failed" => 1
# },
# "status" => 400
# }
# }
# ]
#
#
# @example Import all records into the index
#
Expand Down Expand Up @@ -99,20 +121,19 @@ module ClassMethods
#
# @example Update the batch before yielding it
#
# class Article
# # ...
# def self.enrich(batch)
# batch.each do |item|
# item.metadata = MyAPI.get_metadata(item.id)
# end
# batch
# end
# end
# class Article
# # ...
# def self.enrich(batch)
# batch.each do |item|
# item.metadata = MyAPI.get_metadata(item.id)
# end
# batch
# end
# end
#
# Article.import preprocess: :enrich
#
# @example Return an array of error elements instead of the number of errors, eg.
# to try importing these records again
# @example Return an array of error elements instead of the number of errors, e.g. to try importing these records again
#
# Article.import return: 'errors'
#
Expand Down