From 9fdc3e89823c933d70cd26b4da7b67a5f3f6c02e Mon Sep 17 00:00:00 2001 From: Brian Woodward Date: Tue, 6 May 2014 12:05:25 -0700 Subject: [PATCH] Since the `from` property is doing this `from: (pageNum - 1) * perPage,` logic, I think the default for `pageNum` should be `1`. Otherwise it would results it `-15` when `pageNum` and `perPage` are defaults. --- docs/quick_start.asciidoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/quick_start.asciidoc b/docs/quick_start.asciidoc index 36c2041ec..06f1794eb 100644 --- a/docs/quick_start.asciidoc +++ b/docs/quick_start.asciidoc @@ -112,7 +112,7 @@ NOTE: In this example, `request` and `response` are http://expressjs.com/api.htm [source,js] ----------------- -var pageNum = request.param('page', 0); +var pageNum = request.param('page', 1); var perPage = request.param('per_page', 15); var userQuery = request.param('search_query'); var userId = request.session.userId; @@ -158,4 +158,4 @@ client.search({ }); ----------------- -You can find a lot more information about filters http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-filters.html[here] \ No newline at end of file +You can find a lot more information about filters http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-filters.html[here]