Module: SwiftypeEnterprise::Client::ContentSourceDocuments
- Included in:
- SwiftypeEnterprise::Client
- Defined in:
- lib/swiftype-enterprise/client.rb
Overview
Documents have fields that can be searched or filtered.
For more information on indexing documents, see the Content Source documentation.
Instance Method Summary collapse
-
#destroy_documents(content_source_key, document_ids) ⇒ Array<Hash>
Destroy a batch of documents given a list of external IDs.
-
#index_documents(content_source_key, documents) ⇒ Array<Hash>
Index a batch of documents using the Content Source API.
Instance Method Details
#destroy_documents(content_source_key, document_ids) ⇒ Array<Hash>
Destroy a batch of documents given a list of external IDs
67 68 69 70 |
# File 'lib/swiftype-enterprise/client.rb', line 67 def destroy_documents(content_source_key, document_ids) document_ids = Array(document_ids) post("ent/sources/#{content_source_key}/documents/bulk_destroy.json", document_ids) end |
#index_documents(content_source_key, documents) ⇒ Array<Hash>
Index a batch of documents using the Content Source API.
54 55 56 57 58 |
# File 'lib/swiftype-enterprise/client.rb', line 54 def index_documents(content_source_key, documents) documents = Array(documents).map! { |document| normalize_document(document) } async_create_or_update_documents(content_source_key, documents) end |