From fb678b566633cfe454b8506dfc433890febb7243 Mon Sep 17 00:00:00 2001 From: Michael Huang Date: Mon, 21 Jan 2013 10:52:45 -0800 Subject: [PATCH] Added function for create_or_update_documents (currently undocumented, found out about it after contacting support) --- swiftype.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/swiftype.php b/swiftype.php index 359e70f..3b43ccc 100644 --- a/swiftype.php +++ b/swiftype.php @@ -91,6 +91,10 @@ public function update_documents($engine_id, $document_type_id, $documents = arr return $this->put($this->documents_path($engine_id, $document_type_id).'/bulk_update', array(), array('documents' => $documents)); } + public function create_or_update_documents($engine_id, $document_type_id, $documents = array()) { + return $this->post($this->documents_path($engine_id, $document_type_id).'/bulk_create_or_update', array(), array('documents' => $documents)); + } + public function destroy_document($engine_id, $document_type_id, $document_id) { return $this->delete($this->document_path($engine_id, $document_type_id, $document_id)); }