v0.5.0
Added functions to use Indexing API to create, update, fetch, and delete single documents or batches of documents. The full indexing API documentation can be found at addsearch.com
Example of indexing a document:
// Define a document (schemaless)
const doc = {
custom_fields: {
'name': 'Example product',
'description': 'Description for the example product',
'price_cents': 599,
'average_customer_rating': 4.5
}
};
// Save the document
client.saveDocument(doc)
.then(response => {
console.log(response);
})
.catch(error => {
console.log(error);
});