feathers-solr-node
Advanced tools
Comparing version 0.2.1 to 0.2.2
const queryParser = require('./utils/queryParser'); | ||
const solrClient = require('./solr-client/solr'); | ||
const errors = require('feathers-errors'); | ||
const errors = require('@feathersjs/errors'); | ||
const _ = require('./utils/util'); | ||
@@ -52,2 +52,5 @@ | ||
let query = this.queryParser.parseQuery(params.query); | ||
if(query instanceof errors.BadRequest){ | ||
return Promise.reject(query); | ||
} | ||
//console.log("this.queryParser", query); | ||
@@ -67,2 +70,5 @@ return new Promise((resolve, reject) => { | ||
let query = this.queryParser.parseQuery(params.query); | ||
if(query instanceof errors.BadRequest){ | ||
return Promise.reject(query); | ||
} | ||
return new Promise((resolve, reject) => { | ||
@@ -69,0 +75,0 @@ this.solrClient.$search(query, (err, res) => { |
const _ = require('./util'); | ||
const errors = require('@feathersjs/errors'); | ||
class QueryParser { | ||
@@ -41,3 +42,3 @@ constructor(options) { | ||
queryObj.filter = []; | ||
Object.keys(query).forEach((item) => { | ||
Object.keys(query).every((item) => { | ||
if (this.mapKey[item]) { | ||
@@ -48,3 +49,9 @@ let value = this[item](item, query[item]); | ||
let $filter = this.filterBuilder(item, query[item]); | ||
queryObj.filter.push(...$filter); | ||
if($filter) { | ||
queryObj.filter.push(...$filter); | ||
} | ||
else { | ||
queryObj = new errors.BadRequest(`undefined field ${item}`); | ||
return false; | ||
} | ||
} | ||
@@ -60,5 +67,6 @@ }); | ||
} | ||
if (item[0] !== '$') { | ||
return this.filter(item, param); | ||
if (item[0] === '$') { | ||
return false; | ||
} | ||
return this.filter(item, param); | ||
} | ||
@@ -65,0 +73,0 @@ |
@@ -10,3 +10,3 @@ { | ||
"description": "Solr Adapter for Feathersjs. Base on Solr-client, so can also used as a Solr-client", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"repository": { | ||
@@ -26,6 +26,6 @@ "type": "git", | ||
"dependencies": { | ||
"@feathersjs/errors": "^3.3.4", | ||
"JSONStream": "^1.3.4", | ||
"bluebird": "^3.5.2", | ||
"duplexer": "^0.1.1", | ||
"feathers-errors": "^2.9.2", | ||
"httperror": "^0.2.3", | ||
@@ -32,0 +32,0 @@ "json-bigint": "^0.3.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
107276
30
3101
+ Added@feathersjs/errors@^3.3.4
+ Added@feathersjs/errors@3.3.6(transitive)
+ Addeddebug@4.3.7(transitive)
- Removedfeathers-errors@^2.9.2
- Removeddebug@3.2.7(transitive)
- Removedfeathers-errors@2.9.2(transitive)