Class: GdsApi::Search::V1

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/gds_api/search.rb

Instance Method Summary collapse

Instance Method Details

#add_document(type, id, document) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/gds_api/search.rb', line 9

def add_document(type, id, document)
  post_json(
    documents_url,
    document.merge(
      _type: type,
      _id: id,
    ),
  )
end

#delete_document(type, id) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/gds_api/search.rb', line 19

def delete_document(type, id)
  delete_json(
    "#{documents_url}/#{id}",
    nil,
    _type: type,
  )
end