Skip to content
This repository has been archived by the owner on Feb 6, 2018. It is now read-only.

Commit

Permalink
When document type is delete, there is no need to send fields att…
Browse files Browse the repository at this point in the history
…ribute.

In fact, doing so will result in a warning like:

     "message" => "\"delete\" has unknown attribute(s): ['fields'] (near operation with index 1; document_id developmentdrewslzimaclocal67)"
  • Loading branch information
drewda committed Aug 1, 2013
1 parent dfc1e71 commit 21fa9bd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/aws_cloud_search/document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,13 @@ def to_hash
h = {
:type => @type,
:id => @id,
:version => @version,
:fields => @fields
:version => @version
}
h[:lang] = @lang unless (@type == 'delete')

unless @type == 'delete'
h[:fields] = @fields
h[:lang] = @lang
end

h
end
Expand Down

0 comments on commit 21fa9bd

Please sign in to comment.