Comparing version 2.0.0 to 2.1.0
@@ -57,3 +57,3 @@ var elasticsearch = require('elasticsearch'); | ||
} | ||
}; | ||
} | ||
@@ -341,5 +341,15 @@ return this; | ||
}; | ||
} | ||
/** | ||
* Returns the raw query that Elasticsearch will execute | ||
* Useful methood for debugging or modify raw ElasticSearch queries | ||
* @param {String} type Type of queries: search, count (search by default) | ||
* @return {Object} ElasticSearch Query | ||
*/ | ||
this.raw = function(type) { | ||
return this._buildQuery({output: type || 'search'}); | ||
}; | ||
}; | ||
module.exports = Elasto; | ||
{ | ||
"name": "elasto", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "ElasticSearch client", | ||
@@ -5,0 +5,0 @@ "main": "index", |
@@ -1,7 +0,4 @@ | ||
'use strict'; | ||
var chai = require('chai'); | ||
chai.should(); | ||
chai.use(require('chai-as-promised')); | ||
var expect = chai.expect; | ||
var _ = require('lodash'); | ||
@@ -74,3 +71,3 @@ var Bluebird = require('bluebird'); | ||
description: 'twitty tweet' //leave static | ||
} | ||
}; | ||
}; | ||
@@ -151,3 +148,3 @@ | ||
}) | ||
.forEach(function(value, i){ | ||
.forEach(function(value){ | ||
value.should.not.be.lessThan(previous); | ||
@@ -295,3 +292,3 @@ previous = value; | ||
_.keys(doc).length.should.equal(2); | ||
}) | ||
}); | ||
}) | ||
@@ -372,2 +369,38 @@ .should.eventually.notify(done); | ||
}); | ||
it('should return a search query by default when calling .raw()', function() { | ||
var raw = Elasto.query({ | ||
index: 'circle_test', | ||
type: 'tweets' | ||
}) | ||
.fields('name') | ||
.from(10) | ||
.raw(); | ||
raw.should.be.ok; | ||
}); | ||
it('should return a search query when calling .raw() with query', function() { | ||
var raw = Elasto.query({ | ||
index: 'circle_test', | ||
type: 'tweets' | ||
}) | ||
.fields('name') | ||
.from(10) | ||
.raw('query'); | ||
raw.should.be.ok; | ||
}); | ||
it('should return a search query by default when calling .raw() with count', function() { | ||
var raw = Elasto.query({ | ||
index: 'circle_test', | ||
type: 'tweets' | ||
}) | ||
.fields('name') | ||
.from(10) | ||
.raw('count'); | ||
raw.should.be.ok; | ||
}); | ||
}); | ||
@@ -374,0 +407,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34168
11
651