From 4003840ca90d360970a558242e11c3dc0c5c5f82 Mon Sep 17 00:00:00 2001 From: Andreas Zoellner Date: Thu, 4 Jun 2015 17:32:27 -0700 Subject: [PATCH] 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