think_elasticsearch
Advanced tools
Comparing version 1.0.10 to 1.0.11
@@ -170,2 +170,3 @@ 'use strict'; | ||
this.config = config; | ||
this.logSql = config.db_log || false; | ||
this.queryObj = { | ||
@@ -229,3 +230,3 @@ body: { | ||
return this.socket().connect().then(function (conn) { | ||
_lib2.default.log((0, _stringify2.default)(_this2.queryObj), 'ES', Date.now()); | ||
_this2.logSql && _lib2.default.log((0, _stringify2.default)(_this2.queryObj), 'ES', Date.now()); | ||
return conn.search(_this2.queryObj); | ||
@@ -245,3 +246,3 @@ }).then(function (data) { | ||
return this.socket().connect().then(function (conn) { | ||
_lib2.default.log((0, _stringify2.default)(_this3.queryObj), 'ES', Date.now()); | ||
_this3.logSql && _lib2.default.log((0, _stringify2.default)(_this3.queryObj), 'ES', Date.now()); | ||
return conn[optype](_this3.queryObj); | ||
@@ -541,2 +542,3 @@ }).then(function (data) { | ||
where: true, | ||
version: true, | ||
order: true, | ||
@@ -552,3 +554,3 @@ match: true, | ||
add: { index: true, type: true, id: true }, | ||
update: { index: true, type: true, where: true, match: true, filter: true, id: true }, | ||
update: { index: true, type: true, version: true, where: true, match: true, filter: true, id: true }, | ||
delete: { index: true, type: true, where: true }, | ||
@@ -596,2 +598,6 @@ count: { index: true, type: true, aggs: true, match: true, limit: true, filter: true, where: true }, | ||
_class.prototype.builderVersion = function builderVersion(optionsVerison) { | ||
this.queryObj.version = optionsVerison; | ||
}; | ||
/** | ||
@@ -598,0 +604,0 @@ * 设定id |
@@ -884,3 +884,2 @@ 'use strict'; | ||
options.type = this.type; | ||
return options; | ||
@@ -887,0 +886,0 @@ }; |
{ | ||
"name": "think_elasticsearch", | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"description": "基于elasticsearch.js的elasticsearch工具", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -89,2 +89,3 @@ /** | ||
this.config = config; | ||
this.logSql = config.db_log || false; | ||
this.queryObj = { | ||
@@ -141,3 +142,3 @@ body: { | ||
return this.socket().connect().then(conn=> { | ||
lib.log(JSON.stringify(this.queryObj), 'ES', Date.now()); | ||
this.logSql && lib.log(JSON.stringify(this.queryObj), 'ES', Date.now()); | ||
return conn.search(this.queryObj); | ||
@@ -153,3 +154,3 @@ }).then(data=> { | ||
return this.socket().connect().then(conn=> { | ||
lib.log(JSON.stringify(this.queryObj), 'ES', Date.now()); | ||
this.logSql && lib.log(JSON.stringify(this.queryObj), 'ES', Date.now()); | ||
return conn[optype](this.queryObj); | ||
@@ -411,2 +412,3 @@ }).then(data=> { | ||
where: true, | ||
version: true, | ||
order: true, | ||
@@ -422,3 +424,3 @@ match: true, | ||
add: {index: true, type: true, id: true}, | ||
update: {index: true, type: true, where: true, match: true, filter: true, id: true}, | ||
update: {index: true, type: true, version: true, where: true, match: true, filter: true, id: true}, | ||
delete: {index: true, type: true, where: true}, | ||
@@ -462,3 +464,7 @@ count: {index: true, type: true, aggs: true, match: true, limit: true, filter: true, where: true}, | ||
builderVersion(optionsVerison) { | ||
this.queryObj.version = optionsVerison; | ||
} | ||
/** | ||
@@ -465,0 +471,0 @@ * 设定id |
@@ -492,3 +492,2 @@ /** | ||
options.type = this.type; | ||
return options; | ||
@@ -495,0 +494,0 @@ } |
@@ -18,3 +18,3 @@ /** | ||
port: config.db_port || '9200', | ||
log: config.db_log || 'error' | ||
log: config.db_log || 'error', | ||
} | ||
@@ -21,0 +21,0 @@ } |
@@ -24,3 +24,3 @@ /** | ||
bookM.where({id: 'AVf_6uxvvuLo1zgrtaIC'}) | ||
.update(updateData) | ||
.update(updateData, {version: 1}) | ||
.then(res=> { | ||
@@ -27,0 +27,0 @@ "use strict"; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
692052
70
5233
1
26