From 09aab06698e9fcbe97e136400cc036b618e0c9bc Mon Sep 17 00:00:00 2001 From: Andreas Zoellner Date: Wed, 3 Jun 2015 15:09:40 -0700 Subject: [PATCH 1/3] Update api_methods.asciidoc updated client.percolate examples to work with latest (reflecting changes to Percolator API as described here: https://www.elastic.co/blog/percolator-redesign-blog-post) --- docs/api_methods.asciidoc | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/docs/api_methods.asciidoc b/docs/api_methods.asciidoc index f33b3eacb..b688beb1f 100644 --- a/docs/api_methods.asciidoc +++ b/docs/api_methods.asciidoc @@ -1269,8 +1269,8 @@ The default method is `POST` and the usual < Date: Thu, 4 Jun 2015 17:32:04 -0700 Subject: [PATCH 2/3] Revert "Update api_methods.asciidoc" This reverts commit 09aab06698e9fcbe97e136400cc036b618e0c9bc. --- docs/api_methods.asciidoc | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/docs/api_methods.asciidoc b/docs/api_methods.asciidoc index b688beb1f..f33b3eacb 100644 --- a/docs/api_methods.asciidoc +++ b/docs/api_methods.asciidoc @@ -1269,8 +1269,8 @@ The default method is `POST` and the usual < Date: Thu, 4 Jun 2015 17:32:27 -0700 Subject: [PATCH 3/3] applied to correct file: updated client.percolate examples to work with latest (reflecting changes to Percolator API as described here: https://www.elastic.co/blog/percolator-redesign-blog-post) --- docs/_examples/percolate.asciidoc | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/docs/_examples/percolate.asciidoc b/docs/_examples/percolate.asciidoc index 82ddae7bd..df367e2bd 100644 --- a/docs/_examples/percolate.asciidoc +++ b/docs/_examples/percolate.asciidoc @@ -2,8 +2,8 @@ [source,js] --------- client.index({ - index: '_percolator', - type: 'myindex', + index: 'myindex', + type: '.percolator', id: 'alert-1', body: { // This query will be run against documents sent to percolate @@ -18,8 +18,8 @@ client.index({ }); client.index({ - index: '_percolator', - type: 'myindex', + index: 'myindex', + type: '.percolator', id: 'alert-2', body: { // This query will also be run against documents sent to percolate @@ -39,6 +39,7 @@ client.index({ --------- client.percolate({ index: 'myindex', + type: 'mytype', body: { doc: { title: "Foo" @@ -47,13 +48,14 @@ client.percolate({ }, function (error, response) { // response would equal // { - // ok:true, - // matches: [ "alert-1" ] + // total: 1, + // matches: [ { _index: 'myindex', _id: 'alert-1' } ] // } }); client.percolate({ index: 'myindex', + type: 'mytype', body: { doc: { title: "Foo Bar" @@ -62,8 +64,11 @@ client.percolate({ }, function (error, response) { // response would equal // { - // ok:true, - // matches: [ "alert-1", "alert-2" ] + // total: 2, + // matches: [ + // { _index: 'myindex', _id: 'alert-1' }, + // { _index: 'myindex', _id: 'alert-2' } + // ] // } }); --------- \ No newline at end of file