elastic-particles
Advanced tools
Comparing version 0.0.9 to 0.0.10
@@ -19,4 +19,4 @@ 'use strict'; | ||
/** | ||
* Sets the query filter to an instance of an Elastic Filter.] | ||
* @param {Filter} filter instance of ./elasticsearch/filters filter. | ||
* Sets the query to an instance of an Elastic query. | ||
* @param {Filter} query instance of ./elasticsearch/queries query. | ||
*/ | ||
@@ -29,3 +29,3 @@ ElasticQuery.prototype.setQuery = function setQuery(query) { | ||
/** | ||
* Sets the query filter to an instance of an Elastic Filter.] | ||
* Sets the query filter to an instance of an Elastic Filter. | ||
* @param {Filter} filter instance of ./elasticsearch/filters filter. | ||
@@ -44,2 +44,10 @@ */ | ||
/** | ||
* Sets the sort to the specified field name (also supports _doc for natural sort). | ||
*/ | ||
ElasticQuery.prototype.setSort = function setSort(field) { | ||
this._sort = field; | ||
return this; | ||
}; | ||
/** | ||
* Tells which source fields to include. | ||
@@ -103,2 +111,5 @@ * @param {Array} includes Fields to include in source. Set to false instead of array to not pass _source. | ||
if (this._sort) { | ||
q.sort = this._sort; | ||
} | ||
if (this._size) { | ||
@@ -105,0 +116,0 @@ q.size = this._size; |
{ | ||
"name": "elastic-particles", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"description": "Building blocks for Elastic queries, filters, and aggregations which can be re-used, combed, and nested.", | ||
@@ -5,0 +5,0 @@ "author": { |
39829
976