Sha256: e178ca9f58c37fda1743fe62d1fa5e2b92d0b2da703f346ba40b5f448e085950

Contents?: true

Size: 992 Bytes

Versions: 52

Compression:

Stored size: 992 Bytes

Contents

module Elasticsearch
  module API
    module Actions

      # Create a document.
      #
      # Enforce the _create_ operation when indexing a document --
      # the operation will return an error when the document already exists.
      #
      # @example Create a document
      #
      #     client.create index: 'myindex',
      #                   type: 'mytype',
      #                   id: '1',
      #                   body: {
      #                    title: 'Test 1',
      #                    tags: ['y', 'z'],
      #                    published: true,
      #                    published_at: Time.now.utc.iso8601,
      #                    counter: 1
      #                   }
      #
      # @option (see Actions#index)
      #
      # (The `:op_type` argument is ignored.)
      #
      # @see http://elasticsearch.org/guide/reference/api/index_/
      #
      def create(arguments={})
        index arguments.update :op_type => 'create'
      end
    end
  end
end

Version data entries

52 entries across 52 versions & 2 rubygems

Version Path
elasticsearch-api-1.1.3 lib/elasticsearch/api/actions/create.rb
logstash-filter-cache-redis-0.3.1 vendor/bundle/jruby/1.9/gems/elasticsearch-api-5.0.4/lib/elasticsearch/api/actions/create.rb
logstash-filter-cache-redis-0.3.0 vendor/bundle/jruby/1.9/gems/elasticsearch-api-5.0.4/lib/elasticsearch/api/actions/create.rb
logstash-filter-cache-redis-0.2.0 vendor/bundle/jruby/1.9/gems/elasticsearch-api-5.0.4/lib/elasticsearch/api/actions/create.rb
elasticsearch-api-5.0.4 lib/elasticsearch/api/actions/create.rb
elasticsearch-api-2.0.2 lib/elasticsearch/api/actions/create.rb
elasticsearch-api-5.0.3 lib/elasticsearch/api/actions/create.rb
elasticsearch-api-5.0.2 lib/elasticsearch/api/actions/create.rb
elasticsearch-api-5.0.1 lib/elasticsearch/api/actions/create.rb
elasticsearch-api-2.0.1 lib/elasticsearch/api/actions/create.rb
elasticsearch-api-1.1.2 lib/elasticsearch/api/actions/create.rb
elasticsearch-api-1.1.1 lib/elasticsearch/api/actions/create.rb
elasticsearch-api-5.0.0 lib/elasticsearch/api/actions/create.rb
elasticsearch-api-5.0.0.pre lib/elasticsearch/api/actions/create.rb
elasticsearch-api-2.0.0 lib/elasticsearch/api/actions/create.rb
elasticsearch-api-1.1.0 lib/elasticsearch/api/actions/create.rb
elasticsearch-api-2.0.0.pre lib/elasticsearch/api/actions/create.rb
elasticsearch-api-1.1.pre lib/elasticsearch/api/actions/create.rb
elasticsearch-api-1.0.18 lib/elasticsearch/api/actions/create.rb
elasticsearch-api-1.0.17 lib/elasticsearch/api/actions/create.rb