From 8fd0d49a0377e25124a43a8f8a19cc939f6c90b7 Mon Sep 17 00:00:00 2001 From: delvedor Date: Tue, 19 Feb 2019 09:34:23 +0100 Subject: [PATCH] Updated docs --- docs/extend.asciidoc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/extend.asciidoc b/docs/extend.asciidoc index 643dbb2b5..c80c8bd3f 100644 --- a/docs/extend.asciidoc +++ b/docs/extend.asciidoc @@ -3,7 +3,7 @@ Sometimes you need to reuse the same logic, or you want to build a custom API to allow you simplify your code. + The easiest way to achieve that is by extending the client. -NOTE: You can't override existing methods. +NOTE: If you want to override existing methods, you should specify the `{ force: true }` option. [source,js] ---- @@ -57,6 +57,12 @@ client.extend('utility.delete', ({ makeRequest }) => { } }) +client.extend('indices.delete', { force: true }, ({ makeRequest }) => { + return function _delete (params, options) { + // your code + } +}) + client.supersearch(...) client.utility.index(...) client.utility.delete(...)